[geos-commits] r2113 - trunk/source/operation/predicate

svn_geos at osgeo.org svn_geos at osgeo.org
Tue Jan 29 12:49:18 EST 2008


Author: benjubb
Date: 2008-01-29 12:49:18 -0500 (Tue, 29 Jan 2008)
New Revision: 2113

Modified:
   trunk/source/operation/predicate/RectangleContains.cpp
Log:
Fix a bug in the shortcut test for containment in a rectangle.  This test wasn't correctly testing for case of a point on the boundary.

Was also a bug in JTS (now fixed).




Modified: trunk/source/operation/predicate/RectangleContains.cpp
===================================================================
--- trunk/source/operation/predicate/RectangleContains.cpp	2008-01-29 17:37:22 UTC (rev 2112)
+++ trunk/source/operation/predicate/RectangleContains.cpp	2008-01-29 17:49:18 UTC (rev 2113)
@@ -79,10 +79,9 @@
 {
 	// we already know that the point is contained in the
 	// rectangle envelope
-	if (! (pt.x == rectEnv.getMinX() || pt.x == rectEnv.getMaxX()) )
-		return false;
-	if (! (pt.y == rectEnv.getMinY() || pt.y == rectEnv.getMaxY()) )
-		return false;
+	return 	
+		pt.x == rectEnv.getMinX() || pt.x == rectEnv.getMaxX() ||
+	    pt.y == rectEnv.getMinY() || pt.y == rectEnv.getMaxY();
 
 	return true;
 }



More information about the geos-commits mailing list