[geos-commits] [SCM] GEOS branch 3.8 updated. 47ed49cf70d37448c6555b3c5e7bd9f8a570ba8b

git at osgeo.org git at osgeo.org
Mon May 15 04:50:12 PDT 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GEOS".

The branch, 3.8 has been updated
       via  47ed49cf70d37448c6555b3c5e7bd9f8a570ba8b (commit)
      from  9ff1dd20d79d0c23cb69378d13d7e8f5ec35d323 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 47ed49cf70d37448c6555b3c5e7bd9f8a570ba8b
Author: Mike Taves <mwtoews at gmail.com>
Date:   Mon May 15 23:49:28 2023 +1200

    geosop: change output to show Z

diff --git a/util/geosop/GeosOp.cpp b/util/geosop/GeosOp.cpp
index 8c4ba82df..6b727286b 100644
--- a/util/geosop/GeosOp.cpp
+++ b/util/geosop/GeosOp.cpp
@@ -20,7 +20,9 @@
 #include <geos/geom/GeometryFactory.h>
 #include <geos/operation/valid/MakeValid.h>
 #include <geos/io/WKTReader.h>
+#include <geos/io/WKTWriter.h>
 #include <geos/io/WKBReader.h>
+#include <geos/io/WKBWriter.h>
 
 #include <fstream>
 #include <iostream>
@@ -34,6 +36,7 @@
 
 using namespace geos;
 using namespace geos::geom;
+using namespace geos::io;
 
 std::string const GeosOp::opNames[] = {
     "area",
@@ -449,10 +452,16 @@ void GeosOp::outputGeometry(const Geometry * geom) {
     }
 
     if (args.format == GeosOpArgs::fmtWKB ) {
-        std::cout << *(geom) << std::endl;
+        // output as hex-encoded WKB
+        WKBWriter writer;
+        writer.setOutputDimension(3);
+        writer.writeHEX(*geom, std::cout);
+        std::cout << std::endl;
     }
     else {
         // output as text/WKT
-        std::cout << geom->toString() << std::endl;
+        WKTWriter writer;
+        writer.setOutputDimension(3);
+        std::cout << writer.write(geom) << std::endl;
     }
 }

-----------------------------------------------------------------------

Summary of changes:
 util/geosop/GeosOp.cpp | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list