]> granicus.if.org Git - postgis/commitdiff
ZMflags check on costituent geometries only performed when there is
authorSandro Santilli <strk@keybit.net>
Thu, 21 Oct 2004 19:46:36 +0000 (19:46 +0000)
committerSandro Santilli <strk@keybit.net>
Thu, 21 Oct 2004 19:46:36 +0000 (19:46 +0000)
at least one.

git-svn-id: http://svn.osgeo.org/postgis/trunk@1035 b70326c6-7e19-0410-871a-916f4a2858ee

lwgeom/lwcollection.c

index 61e7bf0cdf5648e9251acd6fecb1dc4ec67fa3e0..95639b6f67c7b25aa2e1cefe22426e56575339a8 100644 (file)
@@ -24,16 +24,16 @@ lwcollection_construct(unsigned int type, int SRID, BOX2DFLOAT4 *bbox,
        {
                hasz = TYPE_HASZ(geoms[0]->type);
                hasm = TYPE_HASM(geoms[0]->type);
-       }
-
 #ifdef CHECK_LWGEOM_ZM
-       zm = TYPE_GETZM(geoms[0]->type);
-       for (i=1; i<ngeoms; i++)
-       {
-               if ( zm != TYPE_GETZM(geoms[i]->type) )
-                       lwerror("lwcollection_construct: mixed dimension geometries");
-       }
+               zm = TYPE_GETZM(geoms[0]->type);
+               for (i=1; i<ngeoms; i++)
+               {
+                       if ( zm != TYPE_GETZM(geoms[i]->type) )
+                               lwerror("lwcollection_construct: mixed dimension geometries");
+               }
 #endif
+       }
+
 
        ret = lwalloc(sizeof(LWCOLLECTION));
        ret->type = lwgeom_makeType_full(hasz, hasm, (SRID!=-1),