[geos-commits] r3803 - trunk/src/geom/prep
svn_geos at osgeo.org
svn_geos at osgeo.org
Mon Jun 3 00:36:48 PDT 2013
Author: strk
Date: 2013-06-03 00:36:48 -0700 (Mon, 03 Jun 2013)
New Revision: 3803
Modified:
trunk/src/geom/prep/PreparedPolygonIntersects.cpp
Log:
Short-circuit prepared polygon/point intersection
Reduces memory fragmentation for area-puntal ops
Modified: trunk/src/geom/prep/PreparedPolygonIntersects.cpp
===================================================================
--- trunk/src/geom/prep/PreparedPolygonIntersects.cpp 2013-05-30 21:00:29 UTC (rev 3802)
+++ trunk/src/geom/prep/PreparedPolygonIntersects.cpp 2013-06-03 07:36:48 UTC (rev 3803)
@@ -22,6 +22,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>
@@ -51,6 +52,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