PostGIS

ST_FlipCoordinates

Prev

7.5. Geometry Editors

Next

Name

ST_FlipCoordinates — Returns a version of a geometry with X and Y axis flipped.

Synopsis

geometry +`*`+ST_FlipCoordinates*(`geometry `geom`)`;

Description

Returns a version of the given geometry with X and Y axis flipped. Useful for fixing geometries which contain coordinates expressed as latitude/longitude (Y,X).

Availability: 2.0.0

check This method supports Circular Strings and Curves.

check This function supports 3d and will not drop the z-index.

check This function supports M coordinates.

check This function supports Polyhedral surfaces.

check This function supports Triangles and Triangulated Irregular Network Surfaces (TIN).

Example

SELECT ST_AsEWKT(ST_FlipCoordinates(GeomFromEWKT('POINT(1 2)')));
 st_asewkt
------------
POINT(2 1)

See Also

Prev

Up

Next

ST_Scroll

Home

ST_Force2D