Skip to content

ST_FlipCoordinates

Returns a new geometry with the X and Y coordinates of each vertex swapped.

Usage

geometry ST_FlipCoordinates(geom: geometry)
geography ST_FlipCoordinates(geog: geography)

Arguments

  • geog (geography): Input geography
  • geom (geometry): Input geometry

Examples

SELECT ST_FlipCoordinates(ST_Point(1, 2));
┌─────────────────────────────────────────────────┐
│ st_flipcoordinates(st_point(Int64(1),Int64(2))) │
│                     geometry                    │
╞═════════════════════════════════════════════════╡
│ POINT(2 1)                                      │
└─────────────────────────────────────────────────┘