Skip to content

v0.2.47..v0.2.48 changeset IoUtils.h

Garret Voltz edited this page Sep 27, 2019 · 1 revision
diff --git a/hoot-core/src/main/cpp/hoot/core/util/IoUtils.h b/hoot-core/src/main/cpp/hoot/core/util/IoUtils.h
index 9dad5b8..823ce14 100644
--- a/hoot-core/src/main/cpp/hoot/core/util/IoUtils.h
+++ b/hoot-core/src/main/cpp/hoot/core/util/IoUtils.h
@@ -30,6 +30,7 @@
 
 // Hoot
 #include <hoot/core/elements/OsmMap.h>
+#include <hoot/core/criterion/ElementCriterion.h>
 
 // Qt
 #include <QString>
@@ -83,6 +84,17 @@ public:
     @param path the file path to save the map to
     */
   static void saveMap(const OsmMapPtr& map, const QString& path);
+
+  /**
+   * Crops a map to a given bounds
+   *
+   * @param map the map to crop
+   * @param bounds the bounds to crop to
+   * @param keepConnectedOobWays if true any way falling outside of the bounds but directly
+   * connected to a way within the bounds will be kept
+   */
+  static void cropToBounds(OsmMapPtr& map, const geos::geom::Envelope& bounds,
+                           const bool keepConnectedOobWays = false);
 };
 
 }
Clone this wiki locally