Skip to content

ST_ToGeography

Converts a geometry to a geography by changing the edge interpretation to spherical.

Usage

geography ST_ToGeography(geom: geometry)
geography ST_ToGeography(geog: geography)

Arguments

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

Description

Converts a geometry to a geography by changing the edge interpretation from planar to spherical. This is a metadata-only operation that does not modify the underlying coordinate data. If the input is already a geography, it is returned unchanged.

Examples

SELECT ST_ToGeography(ST_GeomFromText('POINT (-122.35 47.62)'));
┌────────────────────────────────────────────────────────────────┐
│ st_togeography(st_geomfromtext(Utf8("POINT (-122.35 47.62)"))) │
│                            geography                           │
╞════════════════════════════════════════════════════════════════╡
│ POINT(-122.35 47.62)                                           │
└────────────────────────────────────────────────────────────────┘