Skip to content

v0.2.52..v0.2.53 changeset GeometryUtils.cpp

Garret Voltz edited this page Feb 12, 2020 · 1 revision
diff --git a/hoot-core/src/main/cpp/hoot/core/util/GeometryUtils.cpp b/hoot-core/src/main/cpp/hoot/core/util/GeometryUtils.cpp
index 5d9fbf4..333b9e7 100644
--- a/hoot-core/src/main/cpp/hoot/core/util/GeometryUtils.cpp
+++ b/hoot-core/src/main/cpp/hoot/core/util/GeometryUtils.cpp
@@ -22,7 +22,7 @@
  * This will properly maintain the copyright information. DigitalGlobe
  * copyrights will be updated automatically.
  *
- * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/)
+ * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019, 2020 DigitalGlobe (http://www.digitalglobe.com/)
  */
 
 #include "GeometryUtils.h"
@@ -380,4 +380,29 @@ ElementId GeometryUtils::createBoundsInMap(const OsmMapPtr& map, const geos::geo
   return bbox->getElementId();
 }
 
+QString GeometryUtils::geometryTypeIdToString(const geos::geom::GeometryTypeId& geometryTypeId)
+{
+  switch (geometryTypeId)
+  {
+    case GEOS_POINT:
+      return "point";
+    case GEOS_MULTIPOINT:
+      return "multipoint";
+    case GEOS_LINESTRING:
+      return "linestring";
+    case GEOS_LINEARRING:
+      return "linearring";
+    case GEOS_MULTILINESTRING:
+      return "multilinestring";
+    case GEOS_POLYGON:
+      return "polygon";
+    case GEOS_MULTIPOLYGON:
+      return "multipolygon";
+    case GEOS_GEOMETRYCOLLECTION:
+      return "geometrycollection";
+    default:
+      return "unknown";
+  }
+}
+
 }
Clone this wiki locally