[geos-commits] [SCM] GEOS branch master updated. f2278c485d191afd7219a3877b9eb97a6d52e438

git at osgeo.org git at osgeo.org
Wed Dec 12 10:27:15 PST 2018


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  f2278c485d191afd7219a3877b9eb97a6d52e438 (commit)
      from  c4608a954937ef2c6b6ec452f5f9cf9ff63efb6f (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 f2278c485d191afd7219a3877b9eb97a6d52e438
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Wed Dec 12 10:26:38 2018 -0800

    Change isValidOp to use IndexedPointInAreaLocator
    JTS commit 540a59107fd7b50d1057da11cf65b3d1894c82c1

diff --git a/src/operation/valid/IsValidOp.cpp b/src/operation/valid/IsValidOp.cpp
index 60e296a..54a7a39 100644
--- a/src/operation/valid/IsValidOp.cpp
+++ b/src/operation/valid/IsValidOp.cpp
@@ -22,24 +22,25 @@
 #include "IndexedNestedRingTester.h" // TODO: private header>? --mloskot
 
 #include <geos/platform.h>
-#include <geos/operation/valid/IsValidOp.h>
-#include <geos/operation/valid/ConsistentAreaTester.h>
-#include <geos/operation/valid/ConnectedInteriorTester.h>
-#include <geos/operation/valid/ConnectedInteriorTester.h>
-#include <geos/util/UnsupportedOperationException.h>
-#include <geos/geomgraph/index/SegmentIntersector.h>
-#include <geos/geomgraph/GeometryGraph.h>
-#include <geos/geomgraph/Edge.h>
-#include <geos/algorithm/MCPointInRing.h>
 #include <geos/algorithm/CGAlgorithms.h>
 #include <geos/algorithm/LineIntersector.h>
+#include <geos/algorithm/MCPointInRing.h>
+#include <geos/algorithm/locate/IndexedPointInAreaLocator.h>
+#include <geos/operation/valid/ConnectedInteriorTester.h>
+#include <geos/operation/valid/ConsistentAreaTester.h>
+#include <geos/operation/valid/IsValidOp.h>
 #include <geos/geom/CoordinateSequence.h>
+#include <geos/geom/GeometryCollection.h>
 #include <geos/geom/LineString.h>
 #include <geos/geom/LinearRing.h>
+#include <geos/geom/Location.h>
+#include <geos/geom/MultiPolygon.h>
 #include <geos/geom/Point.h>
 #include <geos/geom/Polygon.h>
-#include <geos/geom/MultiPolygon.h>
-#include <geos/geom/GeometryCollection.h>
+#include <geos/geomgraph/GeometryGraph.h>
+#include <geos/geomgraph/Edge.h>
+#include <geos/geomgraph/index/SegmentIntersector.h>
+#include <geos/util/UnsupportedOperationException.h>
 
 #include <cassert>
 #include <cmath>
@@ -379,9 +380,11 @@ IsValidOp::checkHolesInShell(const Polygon *p, GeometryGraph *graph)
 {
 	assert(dynamic_cast<const LinearRing*>(p->getExteriorRing()));
 
-	const LinearRing *shell=static_cast<const LinearRing*>(
+	const LinearRing *shell = static_cast<const LinearRing*>(
 			p->getExteriorRing());
 
+    const Geometry *shellgeom = static_cast<const Geometry*>(shell);
+
 	auto nholes = p->getNumInteriorRing();
 
 	if(shell->isEmpty())
@@ -407,7 +410,8 @@ IsValidOp::checkHolesInShell(const Polygon *p, GeometryGraph *graph)
 
 	//SimplePointInRing pir(shell);
 	//SIRtreePointInRing pir(shell);
-	MCPointInRing pir(shell);
+	// MCPointInRing pir(shell);
+    locate::IndexedPointInAreaLocator ipial(*shellgeom);
 
 	for(size_t i = 0; i < nholes; ++i)
 	{
@@ -425,9 +429,9 @@ IsValidOp::checkHolesInShell(const Polygon *p, GeometryGraph *graph)
 		 * split the polygon into disconnected interiors.
 		 * This will be caught by a subsequent check.
 		 */
-		if (holePt==nullptr) return;
+		if (holePt == nullptr) return;
 
-		bool outside = !pir.isInside(*holePt);
+		bool outside = (geom::Location::EXTERIOR == ipial.locate(holePt));
 		if (outside) {
 			validErr=new TopologyValidationError(
 				TopologyValidationError::eHoleOutsideShell,

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

Summary of changes:
 src/operation/valid/IsValidOp.cpp | 34 +++++++++++++++++++---------------
 1 file changed, 19 insertions(+), 15 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list