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

Definition at line 2689 of file lwgeom_functions_basic.c.

References geometry_serialize(), input(), lwgeom_flip_coordinates(), lwgeom_free(), and lwgeom_from_gserialized().

2690 {
2691  GSERIALIZED *input = (GSERIALIZED *)PG_DETOAST_DATUM_COPY(PG_GETARG_DATUM(0));
2692  GSERIALIZED *output;
2693  LWGEOM *lwgeom_in = lwgeom_from_gserialized(input);
2694  LWGEOM *lwgeom_out;
2695 
2696  lwgeom_out = lwgeom_flip_coordinates(lwgeom_in);
2697  output = geometry_serialize(lwgeom_out);
2698 
2699  lwgeom_free(lwgeom_in);
2700  PG_FREE_IF_COPY(input, 0);
2701 
2702  PG_RETURN_POINTER(output);
2703 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1006
static int input(void)
LWGEOM * lwgeom_flip_coordinates(LWGEOM *in)
Reverse the X and Y coordinate order.
Definition: lwgeom.c:1390
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)

Here is the call graph for this function: