PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ ST_FlipCoordinates()

Datum ST_FlipCoordinates ( PG_FUNCTION_ARGS  )

Definition at line 2672 of file lwgeom_functions_basic.c.

References geometry_serialize(), lwgeom_free(), lwgeom_from_gserialized(), lwgeom_swap_ordinates(), LWORD_X, and LWORD_Y.

Referenced by ST_RemoveRepeatedPoints().

2673 {
2674  GSERIALIZED *in = PG_GETARG_GSERIALIZED_P_COPY(0);
2675  GSERIALIZED *out;
2676  LWGEOM *lwgeom = lwgeom_from_gserialized(in);
2677 
2679  out = geometry_serialize(lwgeom);
2680 
2681  lwgeom_free(lwgeom);
2682  PG_FREE_IF_COPY(in, 0);
2683 
2684  PG_RETURN_POINTER(out);
2685 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1099
void lwgeom_swap_ordinates(LWGEOM *in, LWORD o1, LWORD o2)
Swap ordinate values in every vertex of the geometry.
Definition: lwgeom.c:1513
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)
Here is the call graph for this function:
Here is the caller graph for this function: