Skip to content
Apache Sedona 1.9.0 is out now, featuring Spark 4.1 support, proj4sedona CRS transformation, Bing Tile functions, and more!

Geography Functions

The Geography type in Sedona represents spatial objects on a spherical (geodesic) model of the Earth. Unlike the planar Geometry type, distance, area, and other measurements performed on Geography objects account for the curvature of the Earth and return results in real-world units (e.g., meters).

Geography Constructors

These functions create geography objects from various formats.

Function Return type Description Since
ST_GeogFromEWKB Geography Construct a Geography from EWKB Binary. This function is an alias of ST_GeogFromWKB. v1.8.0
ST_GeogFromEWKT Geography Construct a Geography from OGC Extended WKT. v1.8.0
ST_GeogFromGeoHash Geography Create Geography from geohash string and optional precision v1.8.0
ST_GeogFromWKB Geography Construct a Geography from WKB Binary. v1.8.0
ST_GeogFromWKT Geography Construct a Geography from WKT. If SRID is not set, it defaults to 0 (unknown). v1.8.0
ST_GeogToGeometry Geometry This function constructs a planar Geometry object from a Geography. While Sedona makes every effort to preserve the original spatial object, the conversion is not always exact because Geography and... v1.8.0
ST_GeomToGeography Geography This function constructs a Geography object from a planar Geometry. This function is intended for geometries defined in a Geographic Coordinate Reference System (CRS), most commonly WGS84 (EPSG:432... v1.8.0

Geography Functions

These functions operate on geography type objects.

Function Return type Description Since
ST_Area Double Return the geodesic area of a geography in square meters (WGS84 spheroid). v1.9.1
ST_AsEWKT String Return the Extended Well-Known Text representation of a geography. v1.8.0
ST_AsText String Return the Well-Known Text (WKT) representation of a geography. v1.9.1
ST_Centroid Geography Return the planar centroid of a geography as a Geography point (computed in projected lon/lat space). v1.9.1
ST_Buffer Geography Return the metric ε-buffer of a geography. Distance is always interpreted as meters along the spheroid. v1.9.1
ST_Envelope Geography Return the bounding box (envelope) of a geography. Supports anti-meridian splitting. v1.8.0
ST_GeometryType String Return the type of a geography as a string (e.g., "ST_Point", "ST_Polygon"). v1.9.1
ST_NPoints Integer Return the number of points (vertices) in a geography. v1.9.0
ST_NumGeometries Integer Return the number of sub-geometries in a geography (1 for single geometries). v1.9.1
ST_Distance Double Return the minimum geodesic distance between two geographies in meters. v1.9.0
ST_Contains Boolean Test whether geography A fully contains geography B. v1.9.0
ST_Equals Boolean Test whether two geographies are spatially equal. v1.9.1