[geos-commits] [SCM] GEOS branch main updated. 67a1b10487bbbe3df8d746fd44ec42d3f91eb949

git at osgeo.org git at osgeo.org
Wed Jul 14 14:38:10 PDT 2021


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, main has been updated
       via  67a1b10487bbbe3df8d746fd44ec42d3f91eb949 (commit)
      from  1bfc5b27493c552fd9a28823358a4c1f4c3b65f7 (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 67a1b10487bbbe3df8d746fd44ec42d3f91eb949
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Wed Jul 14 14:38:06 2021 -0700

    Remove un-used SnapIfNeededOverlayOp

diff --git a/include/geos/operation/overlay/snap/SnapIfNeededOverlayOp.h b/include/geos/operation/overlay/snap/SnapIfNeededOverlayOp.h
deleted file mode 100644
index 4d4843a..0000000
--- a/include/geos/operation/overlay/snap/SnapIfNeededOverlayOp.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/**********************************************************************
- *
- * GEOS - Geometry Engine Open Source
- * http://geos.osgeo.org
- *
- * Copyright (C) 2009 2011  Sandro Santilli <strk at kbt.io>
- *
- * This is free software; you can redistribute and/or modify it under
- * the terms of the GNU Lesser General Public Licence as published
- * by the Free Software Foundation.
- * See the COPYING file for more information.
- *
- ***********************************************************************
- *
- * Last port: operation/overlay/snap/SnapIfNeededOverlayOp.java r320 (JTS-1.12)
- *
- **********************************************************************/
-
-#ifndef GEOS_OP_OVERLAY_SNAP_SNAPIFNEEDEDOVERLAYOP_H
-#define GEOS_OP_OVERLAY_SNAP_SNAPIFNEEDEDOVERLAYOP_H
-
-#include <geos/operation/overlay/OverlayOp.h> // for enums
-
-#include <memory> // for unique_ptr
-
-// Forward declarations
-namespace geos {
-namespace geom {
-class Geometry;
-}
-}
-
-namespace geos {
-namespace operation { // geos::operation
-namespace overlay { // geos::operation::overlay
-namespace snap { // geos::operation::overlay::snap
-
-/** \brief
- * Performs an overlay operation using snapping and enhanced precision
- * to improve the robustness of the result.
- *
- * This class only uses snapping if an error is detected when running
- * the standard JTS overlay code. Errors detected include thrown exceptions
- * (in particular, [TopologyException](@ref util::TopologyException))
- * and invalid overlay computations.
- */
-class SnapIfNeededOverlayOp {
-
-public:
-
-    static std::unique_ptr<geom::Geometry>
-    overlayOp(const geom::Geometry& g0, const geom::Geometry& g1,
-              OverlayOp::OpCode opCode)
-    {
-        SnapIfNeededOverlayOp op(g0, g1);
-        return op.getResultGeometry(opCode);
-    }
-
-    static std::unique_ptr<geom::Geometry>
-    intersection(const geom::Geometry& g0, const geom::Geometry& g1)
-    {
-        return overlayOp(g0, g1, OverlayOp::opINTERSECTION);
-    }
-
-    static std::unique_ptr<geom::Geometry>
-    Union(const geom::Geometry& g0, const geom::Geometry& g1)
-    {
-        return overlayOp(g0, g1, OverlayOp::opUNION);
-    }
-
-    static std::unique_ptr<geom::Geometry>
-    difference(const geom::Geometry& g0, const geom::Geometry& g1)
-    {
-        return overlayOp(g0, g1, OverlayOp::opDIFFERENCE);
-    }
-
-    static std::unique_ptr<geom::Geometry>
-    symDifference(const geom::Geometry& g0, const geom::Geometry& g1)
-    {
-        return overlayOp(g0, g1, OverlayOp::opSYMDIFFERENCE);
-    }
-
-    SnapIfNeededOverlayOp(const geom::Geometry& g1, const geom::Geometry& g2)
-        :
-        geom0(g1),
-        geom1(g2)
-    {
-    }
-
-
-    typedef std::unique_ptr<geom::Geometry> GeomPtr;
-
-    GeomPtr getResultGeometry(OverlayOp::OpCode opCode);
-
-private:
-
-    const geom::Geometry& geom0;
-    const geom::Geometry& geom1;
-
-    // Declare type as noncopyable
-    SnapIfNeededOverlayOp(const SnapIfNeededOverlayOp& other) = delete;
-    SnapIfNeededOverlayOp& operator=(const SnapIfNeededOverlayOp& rhs) = delete;
-};
-
-
-} // namespace geos::operation::overlay::snap
-} // namespace geos::operation::overlay
-} // namespace geos::operation
-} // namespace geos
-
-#endif // ndef GEOS_OP_OVERLAY_SNAP_SNAPIFNEEDEDOVERLAYOP_H
diff --git a/include/geos/operation/union/UnaryUnionOp.h b/include/geos/operation/union/UnaryUnionOp.h
index 0ba3de9..eb1bfe8 100644
--- a/include/geos/operation/union/UnaryUnionOp.h
+++ b/include/geos/operation/union/UnaryUnionOp.h
@@ -30,7 +30,6 @@
 #include <geos/geom/util/GeometryExtracter.h>
 #include <geos/operation/overlay/OverlayOp.h>
 #include <geos/operation/union/CascadedPolygonUnion.h>
-//#include <geos/operation/overlay/snap/SnapIfNeededOverlayOp.h>
 
 #ifdef _MSC_VER
 #pragma warning(push)
@@ -199,12 +198,10 @@ private:
     unionNoOpt(const geom::Geometry& g0)
     {
         using geos::operation::overlay::OverlayOp;
-        //using geos::operation::overlay::snap::SnapIfNeededOverlayOp;
 
         if(! empty.get()) {
             empty = geomFact->createEmptyGeometry();
         }
-        //return SnapIfNeededOverlayOp::overlayOp(g0, *empty, OverlayOp::opUNION);
         return unionFunction->Union(&g0, empty.get());
     }
 
diff --git a/src/geom/Geometry.cpp b/src/geom/Geometry.cpp
index 49c05f3..ff5822b 100644
--- a/src/geom/Geometry.cpp
+++ b/src/geom/Geometry.cpp
@@ -47,7 +47,6 @@
 #include <geos/operation/valid/IsValidOp.h>
 #include <geos/operation/overlay/OverlayOp.h>
 #include <geos/operation/union/UnaryUnionOp.h>
-#include <geos/operation/overlay/snap/SnapIfNeededOverlayOp.h>
 #include <geos/operation/buffer/BufferOp.h>
 #include <geos/operation/distance/DistanceOp.h>
 #include <geos/operation/valid/IsSimpleOp.h>
@@ -77,7 +76,6 @@ using namespace geos::operation::valid;
 using namespace geos::operation::relate;
 using namespace geos::operation::buffer;
 using namespace geos::operation::overlay;
-using namespace geos::operation::overlay::snap;
 using namespace geos::operation::distance;
 using namespace geos::operation;
 
diff --git a/src/operation/overlay/snap/SnapIfNeededOverlayOp.cpp b/src/operation/overlay/snap/SnapIfNeededOverlayOp.cpp
deleted file mode 100644
index 7fd2df4..0000000
--- a/src/operation/overlay/snap/SnapIfNeededOverlayOp.cpp
+++ /dev/null
@@ -1,82 +0,0 @@
-/**********************************************************************
- *
- * GEOS - Geometry Engine Open Source
- * http://geos.osgeo.org
- *
- * Copyright (C) 2009 2011 Sandro Santilli <strk at kbt.io>
- *
- * This is free software; you can redistribute and/or modify it under
- * the terms of the GNU Lesser General Public Licence as published
- * by the Free Software Foundation.
- * See the COPYING file for more information.
- *
- ***********************************************************************
- *
- * Last port: operation/overlay/snap/SnapIfNeededOverlayOp.java r320 (JTS-1.12)
- *
- **********************************************************************/
-
-#include <geos/operation/overlay/snap/SnapIfNeededOverlayOp.h>
-#include <geos/operation/overlay/snap/SnapOverlayOp.h>
-#include <geos/operation/overlay/OverlayOp.h>
-#include <geos/geom/Geometry.h> // for use in unique_ptr
-#include <geos/util.h>
-
-#include <cassert>
-#include <limits> // for numeric_limits
-#include <memory> // for unique_ptr
-
-#ifndef GEOS_DEBUG
-#define GEOS_DEBUG 0
-#endif
-
-
-using namespace geos::geom;
-
-namespace geos {
-namespace operation { // geos.operation
-namespace overlay { // geos.operation.overlay
-namespace snap { // geos.operation.overlay.snap
-
-/* public */
-std::unique_ptr<Geometry>
-SnapIfNeededOverlayOp::getResultGeometry(OverlayOp::OpCode opCode)
-{
-    using geos::util::TopologyException;
-
-    std::unique_ptr<Geometry> result;
-
-    TopologyException origEx;
-
-    // Try with original input
-    try {
-        result.reset(OverlayOp::overlayOp(&geom0, &geom1, opCode));
-        return result;
-    }
-    catch(const TopologyException& ex) {
-        origEx = ex; // save original exception
-#if GEOS_DEBUG
-        std::cerr << "Overlay op threw " << ex.what() << ". Will try snapping now" << std::endl;
-#endif
-    }
-
-    // Try snapping
-    try {
-        result = SnapOverlayOp::overlayOp(geom0, geom1, opCode);
-        return result;
-    }
-    catch(const TopologyException& ex) {
-        ::geos::ignore_unused_variable_warning(ex);
-#if GEOS_DEBUG
-        std::cerr << "Overlay op on snapped geoms threw " << ex.what() << ". Will try snapping now" << std::endl;
-#endif
-        throw origEx;
-    }
-}
-
-
-} // namespace geos.operation.snap
-} // namespace geos.operation.overlay
-} // namespace geos.operation
-} // namespace geos
-
diff --git a/src/operation/union/CascadedPolygonUnion.cpp b/src/operation/union/CascadedPolygonUnion.cpp
index 92d7bba..3741dd9 100644
--- a/src/operation/union/CascadedPolygonUnion.cpp
+++ b/src/operation/union/CascadedPolygonUnion.cpp
@@ -274,7 +274,6 @@ ClassicUnionStrategy::Union(const geom::Geometry* g0, const geom::Geometry* g1)
     // TODO make an rvalue overload for this that can consume its inputs.
     // At a minimum, a copy in the buffer fallback can be eliminated.
     try {
-        // return SnapIfNeededOverlayOp.union(g0, g1);
         return geom::HeuristicOverlay(g0, g1, overlay::OverlayOp::opUNION);
     }
     catch (const util::TopologyException &ex) {

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

Summary of changes:
 .../operation/overlay/snap/SnapIfNeededOverlayOp.h | 111 ---------------------
 include/geos/operation/union/UnaryUnionOp.h        |   3 -
 src/geom/Geometry.cpp                              |   2 -
 .../overlay/snap/SnapIfNeededOverlayOp.cpp         |  82 ---------------
 src/operation/union/CascadedPolygonUnion.cpp       |   1 -
 5 files changed, 199 deletions(-)
 delete mode 100644 include/geos/operation/overlay/snap/SnapIfNeededOverlayOp.h
 delete mode 100644 src/operation/overlay/snap/SnapIfNeededOverlayOp.cpp


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list