]> granicus.if.org Git - postgis/commitdiff
Added is_worth_caching_serialized_bbox(). Renamed lwgeom_setSRID() to
authorSandro Santilli <strk@keybit.net>
Wed, 5 Jan 2005 12:44:47 +0000 (12:44 +0000)
committerSandro Santilli <strk@keybit.net>
Wed, 5 Jan 2005 12:44:47 +0000 (12:44 +0000)
pglwgeom_setSRID(). Fixed a bug in PG_LWGEOM_construct support for
AUTOCACHE_BBOX.

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

lwgeom/BBOXCACHE_BEHAVIOURS
lwgeom/liblwgeom.h
lwgeom/lwgeom_api.c
lwgeom/lwgeom_btree.c
lwgeom/lwgeom_functions_analytic.c
lwgeom/lwgeom_functions_basic.c
lwgeom/lwgeom_geos.c
lwgeom/lwgeom_inout.c
lwgeom/lwgeom_ogc.c
lwgeom/lwgeom_spheroid.c
lwgeom/lwgeom_transform.c

index 9b8bb7bd282d188cf2dcc5933cfabe3bd4f3b848..bb232aff87ae070b10662e47766027a3abf8485e 100644 (file)
@@ -75,7 +75,7 @@ section also use it.
 [ TAINING ]
        GeometryN(geometry,integer) *LWG*
        InteriorRingN(geometry,integer) *LWG*
-       simplify(geometry, float8) *SRL* *EXP*
+       simplify(geometry, float8) *SRL* (*EXP*)
 
        #### could use WHEN_SIMPLE
        #### translating and transforming an eventually present
index d31f9f450ece8b0a87e9c0b7ad32bc7ea6086a49..8b04834c45d742923eb52818e63f1e34ad020c00 100644 (file)
@@ -411,8 +411,9 @@ extern int compute_serialized_bbox_p(char *serialized_form, BOX2DFLOAT4 *box);
  * Evaluate with an heuristic if the provided PG_LWGEOM is worth
  * caching a bbox
  */
-char is_worth_caching_pglwgeom_bbox(PG_LWGEOM *);
-char is_worth_caching_lwgeom_bbox(LWGEOM *);
+char is_worth_caching_pglwgeom_bbox(const PG_LWGEOM *);
+char is_worth_caching_serialized_bbox(const char *);
+char is_worth_caching_lwgeom_bbox(const LWGEOM *);
 
 /*
  * Use this macro to extract the char * required
@@ -691,9 +692,9 @@ int lwgeom_empty_length(int SRID);
 
 // get the SRID from the LWGEOM
 // none present => -1
-extern int lwgeom_getSRID(PG_LWGEOM *lwgeom);
+extern int pglwgeom_getSRID(PG_LWGEOM *lwgeom);
 extern int lwgeom_getsrid(char *serialized);
-extern PG_LWGEOM *lwgeom_setSRID(PG_LWGEOM *lwgeom, int32 newSRID);
+extern PG_LWGEOM *pglwgeom_setSRID(PG_LWGEOM *lwgeom, int32 newSRID);
 
 //get bounding box of LWGEOM (automatically calls the sub-geometries bbox generators)
 extern BOX3D *lw_geom_getBB(char *serialized_form);
index f2083c3797a66a7c575d5b5b76598dadd49cca54..290ddce9ad1daecd3c28fa2bc9823f6d6cac2638 100644 (file)
@@ -1736,7 +1736,7 @@ int lwgeom_getsrid(char *serialized)
 
 // get the SRID from the LWGEOM
 // none present => -1
-int lwgeom_getSRID(PG_LWGEOM *lwgeom)
+int pglwgeom_getSRID(PG_LWGEOM *lwgeom)
 {
        unsigned char type = lwgeom->type;
        char *loc = lwgeom->data;
@@ -1751,11 +1751,11 @@ int lwgeom_getSRID(PG_LWGEOM *lwgeom)
        return get_int32(loc);
 }
 
-// Set the SRID of a LWGEOM
-// Returns a newly allocated LWGEOM object.
+// Set the SRID of a PG_LWGEOM
+// Returns a newly allocated PG_LWGEOM object.
 // Allocation will be done using the lwalloc.
 PG_LWGEOM *
-lwgeom_setSRID(PG_LWGEOM *lwgeom, int32 newSRID)
+pglwgeom_setSRID(PG_LWGEOM *lwgeom, int32 newSRID)
 {
        unsigned char type = lwgeom->type;
        int bbox_offset=0; //0=no bbox, otherwise sizeof(BOX2DFLOAT4)
@@ -1855,7 +1855,7 @@ PG_LWGEOM_construct(char *ser, int SRID, int wantbbox)
        PG_LWGEOM *result;
 
        /* COMPUTE_BBOX FOR_COMPLEX_GEOMS */
-       if ( is_worth_caching_pglwgeom_bbox(ser) ) 
+       if ( is_worth_caching_serialized_bbox(ser) ) 
        {
                // if ( ! wantbbox ) elog(NOTICE, "PG_LWGEOM_construct forced wantbbox=1 due to rule FOR_COMPLEX_GEOMS");
                wantbbox=1;
index fe962ff74bbf1268820194ec314cd8e74ece0abb..8cd5174a20c963e7bed387e92c8d25f201347e98 100644 (file)
@@ -41,7 +41,7 @@ Datum lwgeom_lt(PG_FUNCTION_ARGS)
        elog(NOTICE, "lwgeom_lt called");
 #endif
 
-       if (lwgeom_getSRID(geom1) != lwgeom_getSRID(geom2))
+       if (pglwgeom_getSRID(geom1) != pglwgeom_getSRID(geom2))
        {
                elog(ERROR,
                        "Operation on two GEOMETRIES with different SRIDs\n");
@@ -98,7 +98,7 @@ Datum lwgeom_le(PG_FUNCTION_ARGS)
        elog(NOTICE, "lwgeom_le called");
 #endif
 
-       if (lwgeom_getSRID(geom1) != lwgeom_getSRID(geom2))
+       if (pglwgeom_getSRID(geom1) != pglwgeom_getSRID(geom2))
        {
                elog(ERROR,
                        "Operation on two GEOMETRIES with different SRIDs\n");
@@ -178,7 +178,7 @@ Datum lwgeom_eq(PG_FUNCTION_ARGS)
        elog(NOTICE, "lwgeom_eq called");
 #endif
 
-       if (lwgeom_getSRID(geom1) != lwgeom_getSRID(geom2))
+       if (pglwgeom_getSRID(geom1) != pglwgeom_getSRID(geom2))
        {
                elog(ERROR,
                        "Operation on two GEOMETRIES with different SRIDs\n");
@@ -238,7 +238,7 @@ Datum lwgeom_ge(PG_FUNCTION_ARGS)
        elog(NOTICE, "lwgeom_ge called");
 #endif
 
-       if (lwgeom_getSRID(geom1) != lwgeom_getSRID(geom2))
+       if (pglwgeom_getSRID(geom1) != pglwgeom_getSRID(geom2))
        {
                elog(ERROR,
                        "Operation on two GEOMETRIES with different SRIDs\n");
@@ -310,7 +310,7 @@ Datum lwgeom_gt(PG_FUNCTION_ARGS)
        elog(NOTICE, "lwgeom_gt called");
 #endif
 
-       if (lwgeom_getSRID(geom1) != lwgeom_getSRID(geom2))
+       if (pglwgeom_getSRID(geom1) != pglwgeom_getSRID(geom2))
        {
                elog(ERROR,
                        "Operation on two GEOMETRIES with different SRIDs\n");
@@ -378,7 +378,7 @@ Datum lwgeom_cmp(PG_FUNCTION_ARGS)
        elog(NOTICE, "lwgeom_cmp called");
 #endif
 
-       if (lwgeom_getSRID(geom1) != lwgeom_getSRID(geom2))
+       if (pglwgeom_getSRID(geom1) != pglwgeom_getSRID(geom2))
        {
                elog(ERROR,
                        "Operation on two GEOMETRIES with different SRIDs\n");
@@ -449,6 +449,11 @@ Datum lwgeom_cmp(PG_FUNCTION_ARGS)
 /***********************************************************
  *
  * $Log$
+ * Revision 1.6  2005/01/05 12:44:47  strk
+ * Added is_worth_caching_serialized_bbox(). Renamed lwgeom_setSRID() to
+ * pglwgeom_setSRID(). Fixed a bug in PG_LWGEOM_construct support for
+ * AUTOCACHE_BBOX.
+ *
  * Revision 1.5  2004/09/29 10:50:30  strk
  * Big layout change.
  * lwgeom.h is public API
index 21cc6240093798de6b2e0956ab1df54548c514ac..6108ac70662489d388b2e364245a56ed1ebafeb7 100644 (file)
@@ -319,7 +319,7 @@ Datum LWGEOM_simplify2d(PG_FUNCTION_ARGS)
 
        // copy 2 (see above)
        result = PG_LWGEOM_construct(serialized,
-               lwgeom_getSRID(geom), lwgeom_hasBBOX(geom->type));
+               pglwgeom_getSRID(geom), lwgeom_hasBBOX(geom->type));
 
        PG_RETURN_POINTER(result);
 }
index 643a299d4f035e62d4d97636d3bae704ecf58cf4..d83c7ad900d31efae9d1c4224196581c294a6429 100644 (file)
@@ -1415,7 +1415,7 @@ Datum LWGEOM_mindistance2d(PG_FUNCTION_ARGS)
        geom1 = (PG_LWGEOM *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
        geom2 = (PG_LWGEOM *)PG_DETOAST_DATUM(PG_GETARG_DATUM(1));
 
-       if (lwgeom_getSRID(geom1) != lwgeom_getSRID(geom2))
+       if (pglwgeom_getSRID(geom1) != pglwgeom_getSRID(geom2))
        {
                elog(ERROR,"Operation on two GEOMETRIES with different SRIDs\n");
                PG_RETURN_NULL();
@@ -1457,7 +1457,7 @@ Datum LWGEOM_maxdistance2d_linestring(PG_FUNCTION_ARGS)
        line2 = lwline_deserialize(SERIALIZED_FORM(geom2));
        if ( line2 == NULL ) PG_RETURN_NULL(); // not a linestring
 
-       if (lwgeom_getSRID(geom1) != lwgeom_getSRID(geom2))
+       if (pglwgeom_getSRID(geom1) != pglwgeom_getSRID(geom2))
        {
                elog(ERROR,"Operation on two GEOMETRIES with different SRIDs\n");
                PG_RETURN_NULL();
@@ -1493,7 +1493,7 @@ Datum LWGEOM_translate(PG_FUNCTION_ARGS)
                if ( ! compute_serialized_bbox_p(srl, getbox2d_internal(srl)) )
                {
                        oldgeom = geom;
-                       geom = PG_LWGEOM_construct(srl, lwgeom_getSRID(geom), 0);
+                       geom = PG_LWGEOM_construct(srl, pglwgeom_getSRID(geom), 0);
                        lwfree(oldgeom);
                }
        }
@@ -1602,7 +1602,7 @@ Datum LWGEOM_collect(PG_FUNCTION_ARGS)
        elog(NOTICE, "LWGEOM_collect(%s, %s): call", lwgeom_typename(TYPE_GETTYPE(pglwgeom1->type)), lwgeom_typename(TYPE_GETTYPE(pglwgeom2->type)));
 #endif
        
-       if ( lwgeom_getSRID(pglwgeom1) != lwgeom_getSRID(pglwgeom2) )
+       if ( pglwgeom_getSRID(pglwgeom1) != pglwgeom_getSRID(pglwgeom2) )
        {
                elog(ERROR, "Operation on two GEOMETRIES with different SRIDs\n");
                PG_RETURN_NULL();
@@ -2095,7 +2095,7 @@ Datum LWGEOM_makeline(PG_FUNCTION_ARGS)
                PG_RETURN_NULL();
        }
 
-       if ( lwgeom_getSRID(pglwg1) != lwgeom_getSRID(pglwg2) )
+       if ( pglwgeom_getSRID(pglwg1) != pglwgeom_getSRID(pglwg2) )
        {
                elog(ERROR, "Operation with two geometries with different SRIDs\n");
                PG_RETURN_NULL();
@@ -2250,7 +2250,7 @@ Datum centroid(PG_FUNCTION_ARGS)
 {
        PG_LWGEOM *geom = (PG_LWGEOM *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
        int type = lwgeom_getType(geom->type);
-       int SRID = lwgeom_getSRID(geom);
+       int SRID = pglwgeom_getSRID(geom);
        LWGEOM_EXPLODED *exp = lwgeom_explode(SERIALIZED_FORM(geom));
        LWPOLY *poly=NULL;
        LWPOINT *point;
index 49438f7cd9904da620cea88b056aeab73f20b108..11d83f88d1995bf322b628f0b53378157b61a425 100644 (file)
@@ -206,7 +206,7 @@ Datum unite_garray(PG_FUNCTION_ARGS)
                if ( ! i )
                {
                        geos_result = POSTGIS2GEOS(geom);
-                       SRID = lwgeom_getSRID(geom);
+                       SRID = pglwgeom_getSRID(geom);
 #ifdef DEBUG
                elog(NOTICE, "first geom is a %s", lwgeom_typename(TYPE_GETTYPE(geom->type)));
 #endif
@@ -214,7 +214,7 @@ Datum unite_garray(PG_FUNCTION_ARGS)
                }
                else
                {
-                       if ( SRID != lwgeom_getSRID(geom) )
+                       if ( SRID != pglwgeom_getSRID(geom) )
                        {
                                elog(ERROR,
                                        "Operation on mixed SRID geometries");
@@ -278,8 +278,8 @@ Datum geomunion(PG_FUNCTION_ARGS)
        is3d = ( TYPE_NDIMS(geom1->type) > 2 ) ||
                ( TYPE_NDIMS(geom2->type) > 2 );
 
-       SRID = lwgeom_getSRID(geom1);
-       if ( SRID != lwgeom_getSRID(geom2) )
+       SRID = pglwgeom_getSRID(geom1);
+       if ( SRID != pglwgeom_getSRID(geom2) )
        {
                elog(ERROR, "Operation on two geometries with different SRIDs");
                PG_RETURN_NULL();
@@ -381,8 +381,8 @@ Datum symdifference(PG_FUNCTION_ARGS)
        is3d = ( TYPE_NDIMS(geom1->type) > 2 ) ||
                ( TYPE_NDIMS(geom2->type) > 2 );
 
-       SRID = lwgeom_getSRID(geom1);
-       if ( SRID != lwgeom_getSRID(geom2) )
+       SRID = pglwgeom_getSRID(geom1);
+       if ( SRID != pglwgeom_getSRID(geom2) )
        {
                elog(ERROR, "Operation on two geometries with different SRIDs");
                PG_RETURN_NULL();
@@ -471,7 +471,7 @@ Datum boundary(PG_FUNCTION_ARGS)
 
        geom1 = (PG_LWGEOM *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
 
-       SRID = lwgeom_getSRID(geom1);
+       SRID = pglwgeom_getSRID(geom1);
 
        initGEOS(MAXIMUM_ALIGNOF);
 
@@ -548,7 +548,7 @@ Datum convexhull(PG_FUNCTION_ARGS)
 #endif
 
        geom1 = (PG_LWGEOM *)  PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
-       SRID = lwgeom_getSRID(geom1);
+       SRID = pglwgeom_getSRID(geom1);
 
        initGEOS(MAXIMUM_ALIGNOF);
 
@@ -668,7 +668,7 @@ Datum buffer(PG_FUNCTION_ARGS)
 
 //     elog(NOTICE,"result: %s", GEOSasText(g3) ) ;
 
-       GEOSSetSRID(g3, lwgeom_getSRID(geom1));
+       GEOSSetSRID(g3, pglwgeom_getSRID(geom1));
 
 #ifdef PROFILE
        profstart(PROF_G2P);
@@ -718,8 +718,8 @@ Datum intersection(PG_FUNCTION_ARGS)
        is3d = ( TYPE_NDIMS(geom1->type) > 2 ) ||
                ( TYPE_NDIMS(geom2->type) > 2 );
 
-       SRID = lwgeom_getSRID(geom1);
-       if ( SRID != lwgeom_getSRID(geom2) )
+       SRID = pglwgeom_getSRID(geom1);
+       if ( SRID != pglwgeom_getSRID(geom2) )
        {
                elog(ERROR, "Operation on two geometries with different SRIDs");
                PG_RETURN_NULL();
@@ -835,8 +835,8 @@ Datum difference(PG_FUNCTION_ARGS)
        is3d = ( TYPE_NDIMS(geom1->type) > 2 ) ||
                ( TYPE_NDIMS(geom2->type) > 2 );
 
-       SRID = lwgeom_getSRID(geom1);
-       if ( SRID != lwgeom_getSRID(geom2) )
+       SRID = pglwgeom_getSRID(geom1);
+       if ( SRID != pglwgeom_getSRID(geom2) )
        {
                elog(ERROR, "Operation on two geometries with different SRIDs");
                PG_RETURN_NULL();
@@ -951,7 +951,7 @@ Datum pointonsurface(PG_FUNCTION_ARGS)
 
 //     elog(NOTICE,"result: %s", GEOSasText(g3) ) ;
 
-       GEOSSetSRID(g3, lwgeom_getSRID(geom1));
+       GEOSSetSRID(g3, pglwgeom_getSRID(geom1));
 #ifdef PROFILE
        profstart(PROF_G2P);
 #endif
@@ -1022,7 +1022,7 @@ Datum centroid(PG_FUNCTION_ARGS)
                PG_RETURN_NULL(); 
        }
 
-       GEOSSetSRID(geosresult, lwgeom_getSRID(geom));
+       GEOSSetSRID(geosresult, pglwgeom_getSRID(geom));
 
 #ifdef PROFILE
        profstart(PROF_G2P);
@@ -2396,11 +2396,11 @@ Datum GEOS_polygonize_garray(PG_FUNCTION_ARGS)
                vgeoms[i] = POSTGIS2GEOS(geom);
                if ( ! i )
                {
-                       SRID = lwgeom_getSRID(geom);
+                       SRID = pglwgeom_getSRID(geom);
                }
                else
                {
-                       if ( SRID != lwgeom_getSRID(geom) )
+                       if ( SRID != pglwgeom_getSRID(geom) )
                        {
        elog(ERROR, "polygonize: operation on mixed SRID geometries");
        PG_RETURN_NULL();
index 760e62a1f1a7f6d542a950bc6b69137fe3384f77..420238483037f101cf395b68834e8ecf4a62c7c8 100644 (file)
@@ -333,7 +333,7 @@ Datum LWGEOM_addBBOX(PG_FUNCTION_ARGS)
 }
 
 char
-is_worth_caching_pglwgeom_bbox(PG_LWGEOM *in)
+is_worth_caching_pglwgeom_bbox(const PG_LWGEOM *in)
 {
 #if ! AUTOCACHE_BBOX
        return false;
@@ -343,7 +343,17 @@ is_worth_caching_pglwgeom_bbox(PG_LWGEOM *in)
 }
 
 char
-is_worth_caching_lwgeom_bbox(LWGEOM *in)
+is_worth_caching_serialized_bbox(const char *in)
+{
+#if ! AUTOCACHE_BBOX
+       return false;
+#endif
+       if ( TYPE_GETTYPE((unsigned char)in[0]) == POINTTYPE ) return false;
+       return true;
+}
+
+char
+is_worth_caching_lwgeom_bbox(const LWGEOM *in)
 {
 #if ! AUTOCACHE_BBOX
        return false;
index 703cec87641652d08cc8e9ed69e0e2bfa7af1f0c..f3346729f7ed90790daf5db132d49f34a5d84f20 100644 (file)
@@ -75,9 +75,8 @@ char line_is_closed(LWLINE *line);
 PG_FUNCTION_INFO_V1(LWGEOM_getSRID);
 Datum LWGEOM_getSRID(PG_FUNCTION_ARGS)
 {
-       PG_LWGEOM *lwgeom = (PG_LWGEOM *)  PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
-       int srid = lwgeom_getSRID (lwgeom);
-
+       PG_LWGEOM *pglwgeom=(PG_LWGEOM *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
+       int srid = pglwgeom_getSRID (pglwgeom);
        PG_RETURN_INT32(srid);
 }
 
@@ -89,7 +88,7 @@ Datum LWGEOM_setSRID(PG_FUNCTION_ARGS)
        int newSRID = PG_GETARG_INT32(1);
        PG_LWGEOM *result;
 
-       result = lwgeom_setSRID(lwgeom, newSRID);
+       result = pglwgeom_setSRID(lwgeom, newSRID);
 
        PG_RETURN_POINTER(result);
 }
@@ -487,7 +486,7 @@ Datum LWGEOM_pointn_linestring(PG_FUNCTION_ARGS)
                TYPE_HASZ(line->type), TYPE_HASM(line->type), 1);
 
        // Construct an LWPOINT
-       point = lwpoint_construct(lwgeom_getSRID(geom),
+       point = lwpoint_construct(pglwgeom_getSRID(geom),
                NULL, pts);
 
        // Serialized the point
@@ -496,7 +495,7 @@ Datum LWGEOM_pointn_linestring(PG_FUNCTION_ARGS)
        // And we construct the line
        // TODO: use serialize_buf above, instead ..
        result = PG_LWGEOM_construct(serializedpoint,
-               lwgeom_getSRID(geom), 0);
+               pglwgeom_getSRID(geom), 0);
 
        pfree(point);
        pfree(serializedpoint);
@@ -631,13 +630,13 @@ Datum LWGEOM_startpoint_linestring(PG_FUNCTION_ARGS)
                TYPE_HASM(line->type), 1);
 
        // Construct an LWPOINT
-       point = lwpoint_construct(lwgeom_getSRID(geom), NULL, pts);
+       point = lwpoint_construct(pglwgeom_getSRID(geom), NULL, pts);
 
        // Serialized the point
        serializedpoint = lwpoint_serialize(point);
 
        // And we construct the line (copy again)
-       result = PG_LWGEOM_construct(serializedpoint, lwgeom_getSRID(geom),
+       result = PG_LWGEOM_construct(serializedpoint, pglwgeom_getSRID(geom),
                0);
 
        pfree(point);
@@ -682,13 +681,13 @@ Datum LWGEOM_endpoint_linestring(PG_FUNCTION_ARGS)
                TYPE_HASM(line->type), 1);
 
        // Construct an LWPOINT
-       point = lwpoint_construct(lwgeom_getSRID(geom), NULL, pts);
+       point = lwpoint_construct(pglwgeom_getSRID(geom), NULL, pts);
 
        // Serialized the point
        serializedpoint = lwpoint_serialize(point);
 
        // And we construct the line (copy again)
-       result = PG_LWGEOM_construct(serializedpoint, lwgeom_getSRID(geom),
+       result = PG_LWGEOM_construct(serializedpoint, pglwgeom_getSRID(geom),
                0);
 
        pfree(point);
@@ -706,7 +705,7 @@ Datum LWGEOM_from_text(PG_FUNCTION_ARGS)
        int32 SRID;
        PG_LWGEOM *result = NULL;
 
-       if ( lwgeom_getSRID(geom) != -1 || TYPE_GETZM(geom->type) != 0 )
+       if ( pglwgeom_getSRID(geom) != -1 || TYPE_GETZM(geom->type) != 0 )
        {
                elog(WARNING, "OGC WKT expected, EWKT provided - use GeomFromEWKT() for this");
        }
@@ -715,9 +714,9 @@ Datum LWGEOM_from_text(PG_FUNCTION_ARGS)
        if ( PG_NARGS() > 1 )
        {
                SRID = PG_GETARG_INT32(1);
-               if ( SRID != lwgeom_getSRID(geom) )
+               if ( SRID != pglwgeom_getSRID(geom) )
                {
-                       result = lwgeom_setSRID(geom, SRID);
+                       result = pglwgeom_setSRID(geom, SRID);
                        pfree(geom);
                }
        }
@@ -737,7 +736,7 @@ Datum LWGEOM_from_WKB(PG_FUNCTION_ARGS)
        geom = (PG_LWGEOM *)DatumGetPointer(DirectFunctionCall1(
                LWGEOMFromWKB, PG_GETARG_DATUM(0)));
 
-       if ( lwgeom_getSRID(geom) != -1 || TYPE_GETZM(geom->type) != 0 )
+       if ( pglwgeom_getSRID(geom) != -1 || TYPE_GETZM(geom->type) != 0 )
        {
                elog(WARNING, "OGC WKB expected, EWKB provided - use GeometryFromEWKB() for this");
        }
@@ -747,9 +746,9 @@ Datum LWGEOM_from_WKB(PG_FUNCTION_ARGS)
        if ( PG_NARGS() > 1 )
        {
                SRID = PG_GETARG_INT32(1);
-               if ( SRID != lwgeom_getSRID(geom) )
+               if ( SRID != pglwgeom_getSRID(geom) )
                {
-                       result = lwgeom_setSRID(geom, SRID);
+                       result = pglwgeom_setSRID(geom, SRID);
                        pfree(geom);
                }
        }
index 026511fa43032cad3fdb04b7f9534e4e3aea2998..e322ce5b01ed1c5cfe2bcd74ed9f4b55460b643b 100644 (file)
@@ -494,7 +494,7 @@ Datum LWGEOM_distance_ellipsoid_point(PG_FUNCTION_ARGS)
        LWPOINT *point1, *point2;
        POINT2D *p1, *p2;
 
-       if (lwgeom_getSRID(geom1) != lwgeom_getSRID(geom2))
+       if (pglwgeom_getSRID(geom1) != pglwgeom_getSRID(geom2))
        {
                elog(ERROR, "LWGEOM_distance_ellipsoid_point: Operation on two GEOMETRIES with different SRIDs\n");
                PG_RETURN_NULL();
index 8c3babb6c811fe626f69ae661dda3d41b4e56634..3dfec6af03a482dc35a7f1876998ade7562f77fd 100644 (file)
@@ -257,7 +257,7 @@ Datum transform_geom(PG_FUNCTION_ARGS)
        }
 
        geom = (PG_LWGEOM *)  PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
-       if (lwgeom_getSRID(geom) == -1)
+       if (pglwgeom_getSRID(geom) == -1)
        {
                PG_FREE_IF_COPY(geom, 0);
                elog(ERROR,"tranform: source SRID = -1");
@@ -265,7 +265,7 @@ Datum transform_geom(PG_FUNCTION_ARGS)
        }
 
        // This call will always copy given geometry
-       result = lwgeom_setSRID(geom, result_srid);
+       result = pglwgeom_setSRID(geom, result_srid);
        PG_FREE_IF_COPY(geom, 0);
 
        input_proj4_text  = (PG_GETARG_TEXT_P(1));
@@ -318,7 +318,7 @@ Datum transform_geom(PG_FUNCTION_ARGS)
                if ( ! compute_serialized_bbox_p(srl, getbox2d_internal(srl)) )
                {
                        oldgeom = result;
-                       result = PG_LWGEOM_construct(srl, lwgeom_getSRID(result), 0);
+                       result = PG_LWGEOM_construct(srl, pglwgeom_getSRID(result), 0);
                        lwfree(oldgeom);
                }
        }