ST_TOGEOMETRY()
All functions > GEOSPATIAL > ST_TOGEOMETRY()
Casts a GEOGRAPHY to GEOMETRY, reinterpreting the WGS84 lon/lat coordinates as planar x/y without reprojection.
Signatures
Geography to geometry
Returns: The same shape as a geometry with SRID 4326
ST_TOGEOMETRY(geo: T) → GEOM_MULTIANY sql
| Parameter | Type | Required | Description |
|---|---|---|---|
geo | T | Yes | Geography value |
With:
T: Custom types: GEOG_POINT | GEOG_LINESTRING | GEOG_POLYGON | GEOG_MULTIPOINT | GEOG_MULTILINESTRING | GEOG_MULTIPOLYGON | GEOG_MULTIANY
Signature notes:
- Does NOT reproject coordinates; it only changes the type tag
- The resulting geometry has planar semantics; measurement functions return degree-based results
- To reproject to a metric CRS after casting, use ST_TRANSFORM
- On DuckDB, BigQuery, and DataFusion: a no-op cast at the type level
- On Trino: round-trips through WKT (ST_AsText + ST_GeometryFromText)
- Returns NULL if the input is NULL
Examples
FeatureQL
SELECT
f1 := ST_ASTEXT(ST_TOGEOMETRY(ST_GEOGPOINT(-122.4194, 37.7749))) -- Reinterpret a geography point as geometry
;Result
| f1 VARCHAR |
|---|
| POINT (-122.4194 37.7749) |
On this page