]> granicus.if.org Git - postgis/commitdiff
Fixed bug in multi() leaving SRID in inner geometries.
authorSandro Santilli <strk@keybit.net>
Mon, 28 Mar 2005 09:47:57 +0000 (09:47 +0000)
committerSandro Santilli <strk@keybit.net>
Mon, 28 Mar 2005 09:47:57 +0000 (09:47 +0000)
Added early return for already multi() and BBOX'ed geoms.

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

CHANGES
lwgeom/lwgeom_functions_basic.c

diff --git a/CHANGES b/CHANGES
index d7d323ae046d9c673d90c2b2ef2227f61cedd71c..35265d332daf043fdcd1bc4ae9887f17f29a7eee 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+PostGIS 1.0.0
+??????
+       - BUGFIX dumper 64bit
+
 PostGIS 1.0.0RC5
 2005/03/25
        - small build scripts refinements
index b0a83a0e952e21399f2ea003dc658604033ceca0..7a964fc19c861914be55fd51a50458a84bb9b904 100644 (file)
@@ -1358,6 +1358,19 @@ Datum LWGEOM_force_multi(PG_FUNCTION_ARGS)
        LWGEOM *lwgeoms[1];
        LWGEOM *lwgeom;
        int type;
+       int SRID=-1;
+       BOX2DFLOAT4 *box;
+
+       /*
+        * This funx is a no-op only if a bbox cache is already present
+        * in input. If bbox cache is not there we'll need to handle
+        * automatic bbox addition FOR_COMPLEX_GEOMS.
+        */
+       if ( TYPE_GETTYPE(geom->type) >= MULTIPOINTTYPE &&
+               TYPE_HASBBOX(geom->type) )
+       {
+               PG_RETURN_POINTER(geom);
+       }
 
        // deserialize into lwgeoms[0]
        lwgeom = lwgeom_deserialize(SERIALIZED_FORM(geom));
@@ -1367,10 +1380,14 @@ Datum LWGEOM_force_multi(PG_FUNCTION_ARGS)
        if ( type < MULTIPOINTTYPE )
        {
                type += 3;
+               SRID = lwgeom->SRID;
+               box = lwgeom->bbox;
+               lwgeom->SRID=-1;
+               lwgeom->bbox=NULL;
                lwgeoms[0] = lwgeom;
+               
                lwgeom = (LWGEOM *)lwcollection_construct(type,
-                       lwgeom->SRID, lwgeom->bbox, 1,
-                       lwgeoms);
+                       SRID, box, 1, lwgeoms);
        }