[geos-commits] [SCM] GEOS branch 3.11 updated. 0cd873b504579449cc75564bf92d6587b6d99b1d

git at osgeo.org git at osgeo.org
Mon May 15 04:04:02 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.11 has been updated
       via  0cd873b504579449cc75564bf92d6587b6d99b1d (commit)
      from  25316e96f6dd3375457769811c30ad505e3ce098 (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 0cd873b504579449cc75564bf92d6587b6d99b1d
Author: Mike Taves <mwtoews at gmail.com>
Date:   Mon May 15 22:48:15 2023 +1200

    geosop: change output to show Z

diff --git a/util/geosop/GeosOp.cpp b/util/geosop/GeosOp.cpp
index a575fc75f..334833292 100644
--- a/util/geosop/GeosOp.cpp
+++ b/util/geosop/GeosOp.cpp
@@ -21,6 +21,7 @@
 #include <geos/io/WKTReader.h>
 #include <geos/io/WKTWriter.h>
 #include <geos/io/WKBReader.h>
+#include <geos/io/WKBWriter.h>
 
 #include <fstream>
 #include <iostream>
@@ -493,16 +494,23 @@ 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
         WKTWriter writer;
-        // turn off stoopid fixed precision
-        writer.setTrim(true);
+        writer.setOutputDimension(3);
         if (args.precision >= 0) {
              writer.setRoundingPrecision(args.precision);
         }
+        else {
+            // turn off stoopid fixed precision
+            writer.setTrim(true);
+        }
         std::cout << writer.write(geom) << std::endl;
     }
 }

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

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


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list