[geos-commits] r3804 - in branches/3.3: . src/geom/prep

svn_geos at osgeo.org svn_geos at osgeo.org
Mon Jun 3 00:41:49 PDT 2013


Author: strk
Date: 2013-06-03 00:41:49 -0700 (Mon, 03 Jun 2013)
New Revision: 3804

Modified:
   branches/3.3/NEWS
   branches/3.3/src/geom/prep/PreparedPolygonIntersects.cpp
Log:
Short-circuit prepared polygon/point intersection

Reduces memory fragmentation for area-puntal ops

Modified: branches/3.3/NEWS
===================================================================
--- branches/3.3/NEWS	2013-06-03 07:36:48 UTC (rev 3803)
+++ branches/3.3/NEWS	2013-06-03 07:41:49 UTC (rev 3804)
@@ -6,6 +6,7 @@
     - Speedup GEOSWKBReader_read (#621)
     - Fix RobustLineIntersector handling of invalid intersection points (#622)
     - Reduce likelyhood of invalid output from snap operation (#629, #501)
+    - Reduce memory fragmentation of prepared Polygon/Point intersection op
 
 Changes in 3.3.8
 2013-02-28

Modified: branches/3.3/src/geom/prep/PreparedPolygonIntersects.cpp
===================================================================
--- branches/3.3/src/geom/prep/PreparedPolygonIntersects.cpp	2013-06-03 07:36:48 UTC (rev 3803)
+++ branches/3.3/src/geom/prep/PreparedPolygonIntersects.cpp	2013-06-03 07:41:49 UTC (rev 3804)
@@ -23,6 +23,7 @@
 #include <geos/geom/prep/PreparedPolygon.h>
 #include <geos/geom/Geometry.h>
 #include <geos/geom/Polygon.h>
+#include <geos/geom/Puntal.h>
 #include <geos/geom/MultiPolygon.h>
 #include <geos/geom/prep/PreparedPolygonPredicate.h>
 #include <geos/noding/SegmentString.h>
@@ -52,6 +53,12 @@
 	bool isInPrepGeomArea = isAnyTestComponentInTarget( geom);
 	if ( isInPrepGeomArea ) 
 		return true;
+
+	if ( dynamic_cast<const geom::Puntal *>(geom) ) {
+		// point-in-poly failed, no way there can be an intersection
+		// (NOTE: isAnyTestComponentInTarget also checks for boundary)
+		return false;
+	}
 	
 	// If any segments intersect, result is true
 	noding::SegmentString::ConstVect lineSegStr;



More information about the geos-commits mailing list