]> granicus.if.org Git - postgis/commitdiff
Added AUTOCACHE_BBOX support in PG_LWGEOM_construct().
authorSandro Santilli <strk@keybit.net>
Wed, 5 Jan 2005 10:06:58 +0000 (10:06 +0000)
committerSandro Santilli <strk@keybit.net>
Wed, 5 Jan 2005 10:06:58 +0000 (10:06 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@1218 b70326c6-7e19-0410-871a-916f4a2858ee

lwgeom/BBOXCACHE_BEHAVIOURS
lwgeom/lwgeom_api.c

index ae51929919af2ad53e26f29aa95e4b005385d13b..9b8bb7bd282d188cf2dcc5933cfabe3bd4f3b848 100644 (file)
@@ -33,14 +33,15 @@ points where some BBOX caching strategies could be enforced).
        **SRL** Directly works on the serialized geometries,
                uses internal strategies to construct output.
 
-       *EXP*   Uses deprecated LWEXPLODED, and LWEXPLODED_serialize()
+       *EXP*   Uses LWGEOM_EXPLODED, and lwexploded_serialize()
 
        *LWG*   Uses LWGEOM, pglwgeom_serialize()
 
 
 AUTOCACHE_BBOX is currently used by all functions using *LWG* 
-(pglwgeom_serialize entry point). Other functions explicitly
-listed in the AUTOCACHE_BBOX section also use it.
+(pglwgeom_serialize entry point) and *SRL* (PG_LWGEOM_construct
+entry point). Other functions explicitly listed in the AUTOCACHE_BBOX
+section also use it.
        
 
 [ explicit control ]
index 41ca75648d4a99e03d63bb0840262476b39b5ea8..f2083c3797a66a7c575d5b5b76598dadd49cca54 100644 (file)
@@ -1854,6 +1854,13 @@ PG_LWGEOM_construct(char *ser, int SRID, int wantbbox)
        BOX2DFLOAT4 box;
        PG_LWGEOM *result;
 
+       /* COMPUTE_BBOX FOR_COMPLEX_GEOMS */
+       if ( is_worth_caching_pglwgeom_bbox(ser) ) 
+       {
+               // if ( ! wantbbox ) elog(NOTICE, "PG_LWGEOM_construct forced wantbbox=1 due to rule FOR_COMPLEX_GEOMS");
+               wantbbox=1;
+       }
+
        size = lwgeom_size(ser);
        eptr = ser+size; // end of subgeom
 
@@ -2166,8 +2173,11 @@ char *
 lwexploded_serialize(LWGEOM_EXPLODED *exploded, int wantbbox)
 {
        int sizecom = 0;
-       int size = lwexploded_findlength(exploded, wantbbox);
-       char *result = lwalloc(size);
+       int size;
+       char *result;
+
+       size = lwexploded_findlength(exploded, wantbbox);
+       result = lwalloc(size);
        lwexploded_serialize_buf(exploded, wantbbox, result, &sizecom);
 #ifdef DEBUG
        lwnotice("lwexploded_serialize: findlength:%d, serialize_buf:%d", size, sizecom);