[geos-commits] [SCM] GEOS branch master updated. 7ebc493dd6955e98c70506fa89be5449e8ca8dbd

git at osgeo.org git at osgeo.org
Thu Aug 20 10:24:29 PDT 2020


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, master has been updated
       via  7ebc493dd6955e98c70506fa89be5449e8ca8dbd (commit)
      from  2b85f6e862bc289b648b2bd362db136e93bba2e0 (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 7ebc493dd6955e98c70506fa89be5449e8ca8dbd
Author: Sandro Santilli <strk at kbt.io>
Date:   Thu Aug 20 19:23:55 2020 +0200

    Debug print of OverlayNG failure exceptions

diff --git a/src/operation/overlayng/OverlayNGSnapIfNeeded.cpp b/src/operation/overlayng/OverlayNGSnapIfNeeded.cpp
index bc1f6b6..257457d 100644
--- a/src/operation/overlayng/OverlayNGSnapIfNeeded.cpp
+++ b/src/operation/overlayng/OverlayNGSnapIfNeeded.cpp
@@ -118,11 +118,10 @@ OverlayNGSnapIfNeeded::Overlay(const Geometry* geom0, const Geometry* geom1, int
         * so it can be rethrown if the remaining strategies all fail.
         */
         exOriginal = ex;
-    }
-
 #if GEOS_DEBUG
-    std::cout << std::endl << "Floating point overlay FAILURE." << std::endl;
+        std::cout << std::endl << "Floating point overlay FAILURE: " << ex.what() << std::endl;
 #endif
+    }
 
     /**
      * On failure retry using snapping noding with a "safe" tolerance.
@@ -170,9 +169,16 @@ OverlayNGSnapIfNeeded::overlaySnapping(const Geometry* geom0, const Geometry* ge
     try {
         return overlaySnapTol(geom0, geom1, opCode, snapTol);
     }
-    catch (const geos::util::TopologyException &) {
+    catch (const geos::util::TopologyException &
+#if GEOS_DEBUG
+            ex
+#endif
+    )
+    {
         //---- ignore this exception, just return a nullptr result
-        // TODO: print a debug message here, beware of leaks
+#if GEOS_DEBUG
+        std::cout << std::endl << "overlaySnapping(tol " << snapTol << ") FAILURE: " << ex.what() << std::endl;
+#endif
     }
     return nullptr;
 }
@@ -186,9 +192,16 @@ OverlayNGSnapIfNeeded::overlaySnapBoth(const Geometry* geom0, const Geometry* ge
         std::unique_ptr<Geometry> snap1 = overlaySnapTol(geom1, nullptr, OverlayNG::UNION, snapTol);
         return overlaySnapTol(snap0.get(), snap1.get(), opCode, snapTol);
     }
-    catch (const geos::util::TopologyException &) {
+    catch (const geos::util::TopologyException &
+#if GEOS_DEBUG
+      ex
+#endif
+    )
+    {
         //---- ignore this exception, just return a nullptr result
-        // TODO: print a debug message here, beware of leaks
+#if GEOS_DEBUG
+        std::cout << std::endl << "overlaySnapBoth(tol " << snapTol << ") FAILURE: " << ex.what() << std::endl;
+#endif
     }
     return nullptr;
 }
@@ -249,10 +262,17 @@ OverlayNGSnapIfNeeded::overlaySR(const Geometry* geom0, const Geometry* geom1, i
         result = OverlayNG::overlay(geom0, geom1, opCode, &PM_FLOAT);
         return result;
     }
-    catch (const geos::util::TopologyException &) {
+    catch (const geos::util::TopologyException &
+#if GEOS_DEBUG
+            ex
+#endif
+    )
+    {
         // ignore this exception, since the operation will be rerun
         //System.out.println("Overlay failed");
-        // TODO: print debug line, beware of leaks
+#if GEOS_DEBUG
+        std::cout << std::endl << "overlaySR(tol " << snapTol << ") FAILURE: " << ex.what() << std::endl;
+#endif
     }
     // on failure retry with a "safe" fixed PM
     // this should not throw an exception, but if it does just let it go

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

Summary of changes:
 src/operation/overlayng/OverlayNGSnapIfNeeded.cpp | 38 +++++++++++++++++------
 1 file changed, 29 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list