From: Paul Ramsey Date: Fri, 9 Oct 2009 16:07:37 +0000 (+0000) Subject: Fix for #261 (spurious dimension difference errors) X-Git-Tag: 1.5.0b1~383 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=044508e99497d37ad5286adb1cd60342cae38b9f;p=postgis Fix for #261 (spurious dimension difference errors) git-svn-id: http://svn.osgeo.org/postgis/trunk@4632 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/liblwgeom/g_box.c b/liblwgeom/g_box.c index bf4b91975..95636d3ae 100644 --- a/liblwgeom/g_box.c +++ b/liblwgeom/g_box.c @@ -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 )