Returns a version of the input geometry with x and y coordinates swapped. Use this function to fix geometries where coordinates were entered as latitude/longitude (Y, X) instead of longitude/latitude (X, Y).
Syntax
geometry ST_FlipCoordinates(geometry geom);Parameters
| Parameter | Description |
|---|---|
geom | The input geometry object. |
Supported geometry types
ST_FlipCoordinates supports the following geometry types:
Circular strings and curves
Polyhedral surfaces
Triangles and triangulated irregular network (TIN) surfaces
3D objects
M coordinates
Example
SELECT ST_AsText(ST_FlipCoordinates('POINT(0 1)'::geometry));
st_astext
------------
POINT(1 0)
(1 row)该文章对您有帮助吗?