[geos-commits] [SCM] GEOS branch 3.10 updated. ecb8f54c67d3724bdd9c8f7fb9e279cc11aba1e2

git at osgeo.org git at osgeo.org
Mon May 15 04:03:52 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.10 has been updated
       via  ecb8f54c67d3724bdd9c8f7fb9e279cc11aba1e2 (commit)
      from  6e271a2bca415776226b308ff7d0d0d183f61677 (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 ecb8f54c67d3724bdd9c8f7fb9e279cc11aba1e2
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 249f627b5..0ef7a612d 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>
@@ -480,16 +481,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