Returns a version of the input geometry with its X and Y axes swapped. Useful for correcting geometries where the X and Y coordinates are entered in reverse order.
Syntax
geometry ST_FlipCoordinates(geometry geom);Parameters
| Parameter | Description |
|---|---|
geom | The geometry object whose X and Y coordinates are swapped. |
Usage notes
Supports circular strings, curves, polyhedral surfaces, triangles, triangulated irregular network (TIN) surfaces, and 3D objects.
Supports M coordinates.
Examples
Swap the X and Y coordinates of a point:
SELECT ST_AsText(ST_FlipCoordinates('POINT(0 1)'::geometry));Result:
st_astext
------------
POINT(1 0)
(1 row)该文章对您有帮助吗?