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

Definition at line 93 of file lwgeom_ogc.c.

References geometry_serialize(), lwgeom_free(), lwgeom_from_gserialized(), lwgeom_set_srid(), and result.

94 {
96  GSERIALIZED *geom = (GSERIALIZED *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
97  int srid = PG_GETARG_INT32(1);
98  LWGEOM *lwgeom = lwgeom_from_gserialized(geom);
99  lwgeom_set_srid(lwgeom, srid);
100  result = geometry_serialize(lwgeom);
101  lwgeom_free(lwgeom);
102  PG_FREE_IF_COPY(geom, 0);
103  PG_RETURN_POINTER(result);
104 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1006
char ** result
Definition: liblwgeom.h:218
LWGEOM * geom
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)
void lwgeom_set_srid(LWGEOM *geom, int srid)
Set the SRID on an LWGEOM For collections, only the parent gets an SRID, all the children get SRID_UN...

Here is the call graph for this function: