PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ LWGEOM_longitude_shift()

Datum LWGEOM_longitude_shift ( PG_FUNCTION_ARGS  )

Definition at line 1036 of file lwgeom_functions_basic.c.

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

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

Here is the call graph for this function: