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

Definition at line 1017 of file lwgeom_functions_basic.c.

References dumpnode::geom, geometry_serialize(), lwgeom_drop_bbox(), lwgeom_free(), lwgeom_from_gserialized(), and lwgeom_longitude_shift().

1018 {
1019  GSERIALIZED *geom;
1020  LWGEOM *lwgeom;
1021  GSERIALIZED *ret;
1022 
1023  POSTGIS_DEBUG(2, "LWGEOM_longitude_shift called.");
1024 
1025  geom = PG_GETARG_GSERIALIZED_P_COPY(0);
1026  lwgeom = lwgeom_from_gserialized(geom);
1027 
1028  /* Drop bbox, will be recomputed */
1029  lwgeom_drop_bbox(lwgeom);
1030 
1031  /* Modify geometry */
1032  lwgeom_longitude_shift(lwgeom);
1033 
1034  /* Construct GSERIALIZED */
1035  ret = geometry_serialize(lwgeom);
1036 
1037  /* Release deserialized geometry */
1038  lwgeom_free(lwgeom);
1039 
1040  /* Release detoasted geometry */
1041  pfree(geom);
1042 
1043  PG_RETURN_POINTER(ret);
1044 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1050
void lwgeom_drop_bbox(LWGEOM *lwgeom)
Call this function to drop BBOX and SRID from LWGEOM.
Definition: lwgeom.c:586
void lwgeom_longitude_shift(LWGEOM *lwgeom)
Definition: lwgeom.c:902
LWGEOM * geom
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)

Here is the call graph for this function: