]> granicus.if.org Git - postgis/commitdiff
Added early return from force_collection when input is already a collection
authorSandro Santilli <strk@keybit.net>
Fri, 25 Feb 2005 09:31:54 +0000 (09:31 +0000)
committerSandro Santilli <strk@keybit.net>
Fri, 25 Feb 2005 09:31:54 +0000 (09:31 +0000)
AND has a bbox cache. Suggested by Ron Majer.

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

lwgeom/lwgeom_functions_basic.c

index 563316f5abb0af30bdb7239db534557951c39998..2d07f3d331fe00b0e558cd153ffa8fec63cc5a6f 100644 (file)
@@ -1306,6 +1306,17 @@ Datum LWGEOM_force_collection(PG_FUNCTION_ARGS)
        int SRID;
        BOX2DFLOAT4 *bbox;
 
+       /*
+        * 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) == COLLECTIONTYPE &&
+               TYPE_HASBBOX(geom->type) )
+       {
+               PG_RETURN_POINTER(geom);
+       }
+
        // deserialize into lwgeoms[0]
        lwgeom = lwgeom_deserialize(SERIALIZED_FORM(geom));