]> granicus.if.org Git - postgis/commitdiff
Fix minor logic error in intersects() bbox shortcut.
authorPaul Ramsey <pramsey@cleverelephant.ca>
Wed, 8 Oct 2008 04:25:40 +0000 (04:25 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Wed, 8 Oct 2008 04:25:40 +0000 (04:25 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@3075 b70326c6-7e19-0410-871a-916f4a2858ee

lwgeom/lwgeom_geos_c.c

index db29e626cd25e450521ad31a83e3264b9645f63a..04cebb36667178b5614c0c418017928c89241ee5 100644 (file)
@@ -1424,7 +1424,7 @@ Datum contains(PG_FUNCTION_ARGS)
                        getbox2d_p(SERIALIZED_FORM(geom2), &box2) )
        {
                if ( ( box2.xmin < box1.xmin ) || ( box2.xmax > box1.xmax ) ||
-                               ( box2.ymin < box1.ymin ) || ( box2.ymax > box1.ymax ) )
+                    ( box2.ymin < box1.ymin ) || ( box2.ymax > box1.ymax ) )
                {
                        PG_RETURN_BOOL(FALSE);
                }
@@ -2083,7 +2083,7 @@ Datum intersects(PG_FUNCTION_ARGS)
                if ( box2.xmax < box1.xmin ) PG_RETURN_BOOL(FALSE);
                if ( box2.xmin > box1.xmax ) PG_RETURN_BOOL(FALSE);
                if ( box2.ymax < box1.ymin ) PG_RETURN_BOOL(FALSE);
-               if ( box2.ymin > box2.ymax ) PG_RETURN_BOOL(FALSE);
+               if ( box2.ymin > box1.ymax ) PG_RETURN_BOOL(FALSE);
        }
 
        /*