Added early return from force_collection when input is already a collection

AND has a bbox cache. Suggested by Ron Majer.


git-svn-id: http://svn.osgeo.org/postgis/trunk@1444 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
Sandro Santilli 2005-02-25 09:31:54 +00:00
parent 62c33b30e3
commit 06f6125337

View 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));