PostGIS  2.1.10dev-r@@SVN_REVISION@@
Datum LWGEOM_longitude_shift ( PG_FUNCTION_ARGS  )

Definition at line 1038 of file lwgeom_functions_basic.c.

References geometry_serialize(), lwgeom_drop_bbox(), lwgeom_free(), lwgeom_from_gserialized(), and lwgeom_longitude_shift().

1039 {
1040  GSERIALIZED *geom;
1041  LWGEOM *lwgeom;
1042  GSERIALIZED *ret;
1043 
1044  POSTGIS_DEBUG(2, "LWGEOM_longitude_shift called.");
1045 
1046  geom = (GSERIALIZED *)PG_DETOAST_DATUM_COPY(PG_GETARG_DATUM(0));
1047  lwgeom = lwgeom_from_gserialized(geom);
1048 
1049  /* Drop bbox, will be recomputed */
1050  lwgeom_drop_bbox(lwgeom);
1051 
1052  /* Modify geometry */
1053  lwgeom_longitude_shift(lwgeom);
1054 
1055  /* Construct GSERIALIZED */
1056  ret = geometry_serialize(lwgeom);
1057 
1058  /* Release deserialized geometry */
1059  lwgeom_free(lwgeom);
1060 
1061  /* Release detoasted geometry */
1062  pfree(geom);
1063 
1064  PG_RETURN_POINTER(ret);
1065 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1006
void lwgeom_drop_bbox(LWGEOM *lwgeom)
Call this function to drop BBOX and SRID from LWGEOM.
Definition: lwgeom.c:542
void lwgeom_longitude_shift(LWGEOM *lwgeom)
Definition: lwgeom.c:858
LWGEOM * geom
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)

Here is the call graph for this function: