]> granicus.if.org Git - postgis/commitdiff
Fixed bug in force_collection() leaving spurious bbox cache and SRID info
authorSandro Santilli <strk@keybit.net>
Mon, 14 Feb 2005 20:45:22 +0000 (20:45 +0000)
committerSandro Santilli <strk@keybit.net>
Mon, 14 Feb 2005 20:45:22 +0000 (20:45 +0000)
in inner geometry when applied to single geoms.

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

lwgeom/lwgeom_functions_basic.c

index db745027656a61a3f2e5e48ae35c294dc3693045..429f57fbd0fede9b07aedb2ff45d4a8b6629aa47 100644 (file)
@@ -1287,6 +1287,8 @@ Datum LWGEOM_force_collection(PG_FUNCTION_ARGS)
        PG_LWGEOM *result;
        LWGEOM *lwgeoms[1];
        LWGEOM *lwgeom;
+       int SRID;
+       BOX2DFLOAT4 *bbox;
 
        // deserialize into lwgeoms[0]
        lwgeom = lwgeom_deserialize(SERIALIZED_FORM(geom));
@@ -1300,9 +1302,13 @@ Datum LWGEOM_force_collection(PG_FUNCTION_ARGS)
        // single geom, make it a collection
        else
        {
+               SRID = lwgeom->SRID;
+               bbox = lwgeom->bbox;
+               lwgeom->SRID = -1;
+               lwgeom->bbox = NULL;
                lwgeoms[0] = lwgeom;
                lwgeom = (LWGEOM *)lwcollection_construct(COLLECTIONTYPE,
-                       lwgeom->SRID, lwgeom->bbox, 1,
+                       SRID, bbox, 1,
                        lwgeoms);
        }