Skip to content

v0.2.48..v0.2.49 changeset GeometryUtils.cpp

Garret Voltz edited this page Oct 2, 2019 · 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 acf1620..324d15c 100644
--- a/hoot-core/src/main/cpp/hoot/core/util/GeometryUtils.cpp
+++ b/hoot-core/src/main/cpp/hoot/core/util/GeometryUtils.cpp
@@ -179,6 +179,16 @@ QString GeometryUtils::toString(const Envelope& e)
       arg(e.getMaxY(), 0, 'f', precision);
 }
 
+QString GeometryUtils::toConfigString(const Envelope& e)
+{
+  const int precision = ConfigOptions().getWriterPrecision();
+  return QString("%1,%2,%3,%4").
+      arg(e.getMinX(), 0, 'f', precision).
+      arg(e.getMinY(), 0, 'f', precision).
+      arg(e.getMaxX(), 0, 'f', precision).
+      arg(e.getMaxY(), 0, 'f', precision);
+}
+
 Geometry* GeometryUtils::validateGeometry(const Geometry* g)
 {
   switch (g->getGeometryTypeId())
Clone this wiki locally