[geos-commits] r2419 - in trunk/source: geom/prep
headers/geos/geom/prep
svn_geos at osgeo.org
svn_geos at osgeo.org
Wed Apr 29 04:22:17 EDT 2009
Author: strk
Date: 2009-04-29 04:22:16 -0400 (Wed, 29 Apr 2009)
New Revision: 2419
Modified:
trunk/source/geom/prep/BasicPreparedGeometry.cpp
trunk/source/headers/geos/geom/prep/BasicPreparedGeometry.h
Log:
Sync BasicPreparedGeometry to JTS-1.10 (short-circuit in containsProperly)
Modified: trunk/source/geom/prep/BasicPreparedGeometry.cpp
===================================================================
--- trunk/source/geom/prep/BasicPreparedGeometry.cpp 2009-04-29 08:15:21 UTC (rev 2418)
+++ trunk/source/geom/prep/BasicPreparedGeometry.cpp 2009-04-29 08:22:16 UTC (rev 2419)
@@ -13,7 +13,7 @@
*
**********************************************************************
*
- * Last port: geom/prep/BasicPreparedGeometry.java rev. 1.3 (2007-08-20)
+ * Last port: geom/prep/BasicPreparedGeometry.java rev. 1.5 (JTS-1.10)
*
**********************************************************************/
@@ -86,6 +86,15 @@
bool
BasicPreparedGeometry::containsProperly(const geom::Geometry * g) const
{
+ // since raw relate is used, provide some optimizations
+
+ // short-circuit test
+ if (! baseGeom->getEnvelopeInternal()->contains(g->getEnvelopeInternal()))
+ {
+ return false;
+ }
+
+ // otherwise, compute using relate mask
return baseGeom->relate(g, "T**FF*FF*");
}
Modified: trunk/source/headers/geos/geom/prep/BasicPreparedGeometry.h
===================================================================
--- trunk/source/headers/geos/geom/prep/BasicPreparedGeometry.h 2009-04-29 08:15:21 UTC (rev 2418)
+++ trunk/source/headers/geos/geom/prep/BasicPreparedGeometry.h 2009-04-29 08:22:16 UTC (rev 2419)
@@ -14,7 +14,7 @@
*
**********************************************************************
*
- * Last port: geom/prep/BasicPreparedGeometry.java rev. 1.3 (2007-08-20)
+ * Last port: geom/prep/BasicPreparedGeometry.java rev. 1.5 (JTS-1.10)
*
**********************************************************************/
@@ -146,6 +146,10 @@
*/
bool crosses(const geom::Geometry * g) const;
+ /**
+ * Standard implementation for all geometries.
+ * Supports {@link GeometryCollection}s as input.
+ */
bool disjoint(const geom::Geometry * g) const;
/**
More information about the geos-commits
mailing list