Geography
The Geography function converts GeoJSON or WKT data into the Geography data type.
This function isn't compatible with all data platform connections. To check if your connection supports it, see Supported data platforms and feature compatibility.
Syntax
In GeoJSON and the Geography
data type, coordinate order is always longitude, latitude
.
Geography(value)
The function arguments are:
- value
- Required
- The content to convert to the Geography data type.
- Must be valid GeoJSON or WKT. Otherwise, the function returns
Null
.
Notes
- Valid coordinates have longitude values between
-180
and180
, and latitude values between-90
and90
.- Values outside of these ranges return
null
, and do not appear on maps like Map - Geography.
- Values outside of these ranges return
- On Databricks connections, the longitude value
180
is not valid. It is equivalent to the longitude value-180
.
Examples
Geography('{"coordinates":[-78,42],"type":"Point"}')
Converts the GeoJSON string '{"coordinates":[-78,42],"type":"Point"}'
to the Geography data type, and returns POINT(-78 42)
.
Geography([GeoJSON])
The Geography function returns the following values for the GeoJSON column:

Geography("POINT(-78 42)")
Converts the WKT string "POINT(-78 42)"
to the Geography data type, and returns POINT(-78 42)
.
Geography([WKT])
The Geography function returns the following values for the WKT column:

Updated 4 days ago
Related resources