]> granicus.if.org Git - postgis/commitdiff
Fix for #261 (spurious dimension difference errors)
authorPaul Ramsey <pramsey@cleverelephant.ca>
Fri, 9 Oct 2009 16:07:37 +0000 (16:07 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Fri, 9 Oct 2009 16:07:37 +0000 (16:07 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@4632 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/g_box.c

index bf4b919758e48388f160ef2e8ec401ac92ff5d96..95636d3ae007775f6f1525b73c5b3b185f0a80bd 100644 (file)
@@ -69,8 +69,13 @@ int gbox_merge(GBOX new_box, GBOX *merge_box)
 
 int gbox_overlaps(GBOX g1, GBOX g2)
 {
-       if( g1.flags != g2.flags )
+       
+       /* Make sure our boxes have the same dimensionality */ 
+       if( ! (FLAGS_NDIMS(g1.flags) == FLAGS_NDIMS(g2.flags) && 
+              FLAGS_GET_GEODETIC(g1.flags) == FLAGS_GET_GEODETIC(g2.flags) ) )
+       {
                lwerror("gbox_overlaps: geometries have mismatched dimensionality");
+       }
                
        if( g1.xmax < g2.xmin || g1.ymax < g2.ymin ||
            g1.xmin > g2.xmax || g1.ymin > g2.ymax )