[geos-commits] r3628 - in branches/3.3: . src/operation/polygonize

svn_geos at osgeo.org svn_geos at osgeo.org
Mon May 14 15:00:05 EDT 2012


Author: strk
Date: 2012-05-14 12:00:04 -0700 (Mon, 14 May 2012)
New Revision: 3628

Modified:
   branches/3.3/NEWS
   branches/3.3/src/operation/polygonize/EdgeRing.cpp
Log:
Reduce calls to ptNotInList, greatly speeding up Polygonizer (#545)

Modified: branches/3.3/NEWS
===================================================================
--- branches/3.3/NEWS	2012-05-09 18:02:41 UTC (rev 3627)
+++ branches/3.3/NEWS	2012-05-14 19:00:04 UTC (rev 3628)
@@ -9,6 +9,7 @@
     - Envelope-based short-circuit for symDifference (#543)
     - Fix support for PHP 5.4 (#513)
     - Fix TopologyPreservingSimplifier invalid output on closed line (#508)
+    - Reduce calls to ptNotInList, greatly speeding up Polygonizer (#545)
 
 Changes in 3.3.3
 2012-04-01

Modified: branches/3.3/src/operation/polygonize/EdgeRing.cpp
===================================================================
--- branches/3.3/src/operation/polygonize/EdgeRing.cpp	2012-05-09 18:02:41 UTC (rev 3627)
+++ branches/3.3/src/operation/polygonize/EdgeRing.cpp	2012-05-14 19:00:04 UTC (rev 3628)
@@ -71,12 +71,17 @@
 		const CoordinateSequence *tryCoords =
 			tryRing->getCoordinatesRO();
 
-		testPt=ptNotInList(testRing->getCoordinatesRO(),
-			tryCoords);
+		if ( tryEnv->contains(testEnv) ) {
 
-		if (tryEnv->contains(testEnv)
-			&& CGAlgorithms::isPointInRing(testPt, tryCoords))
+			// TODO: don't copy testPt !
+			testPt = ptNotInList(testRing->getCoordinatesRO(), tryCoords);
+
+			if ( CGAlgorithms::isPointInRing(testPt, tryCoords) ) {
 				isContained=true;
+			}
+
+    }
+
 		// check if this new containing ring is smaller
 		// than the current minimum ring
 		if (isContained) {
@@ -97,6 +102,7 @@
     for (std::size_t i = 0; i < npts; ++i)
     {
         const Coordinate& testPt = testPts->getAt(i);
+        // TODO: shouldn't this be ! isInList ?
         if (isInList(testPt, pts))
             return testPt;
     }



More information about the geos-commits mailing list