ST_GEOGPOINT()

All functions > GEOSPATIAL > ST_GEOGPOINT()

Creates a GEOGRAPHY point from longitude and latitude coordinates in WGS84.

Signatures

Geography point

Returns: A geography point

ST_GEOGPOINT(lon: DOUBLE, lat: DOUBLE) → GEOG_POINT
sql
ParameterTypeRequiredDescription
lonDOUBLEYesLongitude in degrees, range [-180, 180]
latDOUBLEYesLatitude in degrees, range [-90, 90]

Signature notes:

  • Longitude comes first, latitude second (this matches GeoJSON and ISO convention but is the opposite of Google Maps)
  • ST_X / ST_Y on a GEOG_POINT match that order: X is longitude, Y is latitude—swapping arguments is the most common cause of “wrong” real-world coordinates
  • Measurement functions like ST_DISTANCE on GEOGRAPHY values return results in meters
  • Returns NULL if either coordinate is NULL
  • Out of range coordinates produce an error on most engines

Examples

FeatureQL
SELECT
    f1 := ST_ASTEXT(ST_GEOGPOINT(-122.4194, 37.7749)), -- San Francisco (WKT via ST_ASTEXT)
    f2 := ST_ASTEXT(ST_GEOGPOINT(2.3522, 48.8566)) -- Paris (WKT via ST_ASTEXT)
;
Result
f1 VARCHARf2 VARCHAR
POINT (-122.4194 37.7749)POINT (2.3522 48.8566)

Last update at: 2026/05/26 17:22:09