This topic describes the ST_FlipCoordinates function. This function interchanges the x and y coordinates of the input geometry object.
Syntax
geometry ST_FlipCoordinates(geometry geom);
Parameters
Parameter | Description |
---|---|
geom | The geometry object that you want to specify. |
Description
- This function applies when the x and y coordinates are entered in reverse. You can use this function to fix this issue.
- This function supports circular strings, curves, polyhedral surfaces, triangles, triangulated irregular network (TIN) surfaces, and 3D objects.
- This function supports m coordinates.
Examples
Results returned by using the default parameter settings:
SELECT ST_AsText(ST_FlipCoordinates('POINT(0 1)'::geometry));
st_astext
------------
POINT(1 0)
(1 row)