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).
SedonaFlink exposes geography constructors, measurement and output functions, and spatial predicates. Constructors build Geography values and convert between Geometry and Geography; the functions and predicates operate on Geography columns directly. These functions share the same names as their Geometry counterparts — SedonaFlink resolves the geography variant from the column type.
Geography Constructors¶
These functions create geography objects from various formats, or convert between geometry and geography.
| Function | Return type | Description | Since |
|---|---|---|---|
| ST_GeogCollFromText | Geography | Constructs a GeometryCollection geography from the WKT with the given SRID. If SRID is not provided then it defaults to 0. It returns null if the WKT is not a GEOMETRYCOLLECTION. |
v1.9.1 |
| ST_GeogFromEWKB | Geography | Construct a Geography from EWKB Binary. This function is an alias of ST_GeogFromWKB. | v1.9.1 |
| ST_GeogFromEWKT | Geography | Construct a Geography from OGC Extended WKT. | v1.9.1 |
| ST_GeogFromGeoHash | Geography | Create Geography from geohash string and optional precision. | v1.9.1 |
| ST_GeogFromText | Geography | Construct a Geography from WKT. If SRID is not set, it defaults to 0 (unknown). Alias of ST_GeogFromWKT. | v1.9.1 |
| ST_GeogFromWKB | Geography | Construct a Geography from WKB Binary. | v1.9.1 |
| ST_GeogFromWKT | Geography | Construct a Geography from WKT. If SRID is not set, it defaults to 0 (unknown). | v1.9.1 |
| ST_GeogToGeometry | Geometry | Construct a planar Geometry from a Geography. | v1.9.1 |
| ST_GeomToGeography | Geography | Construct a Geography from a planar Geometry. | v1.9.1 |
Geography Functions¶
These functions measure or format geography objects. Measurements are computed on a spherical model of the Earth (radius R = 6 371 008 m, the mean Earth radius), not the WGS84 ellipsoid — areas in square meters and lengths/distances in meters. (ST_Buffer is the exception: it is computed on the WGS84 spheroid.)
| Function | Return type | Description | Since |
|---|---|---|---|
| ST_Area | Double | Return the geodesic area of a geography in square meters. | v1.9.1 |
| ST_AsEWKT | String | Return the EWKT representation of a geography, including its SRID. | v1.9.1 |
| ST_AsText | String | Return the WKT representation of a geography. | v1.9.1 |
| ST_Buffer | Geography | Return the geodesic buffer of a geography (distance in meters). | v1.9.1 |
| ST_Centroid | Geography | Return the centroid of a geography as a Geography point. | v1.9.1 |
| ST_Distance | Double | Return the minimum geodesic distance between two geographies in meters. | v1.9.1 |
| ST_Envelope | Geography | Return the bounding box of a geography. Supports antimeridian splitting. | v1.9.1 |
| ST_GeometryType | String | Return the type of a geography as a string. | v1.9.1 |
| ST_Length | Double | Return the spherical length of a geography in meters. | v1.9.1 |
| ST_NPoints | Integer | Return the number of points (vertices) in a geography. | v1.9.1 |
| ST_NumGeometries | Integer | Return the number of sub-geometries in a geography. | v1.9.1 |
Geography Predicates¶
These functions test spatial relationships between two geographies on the sphere.
| Function | Return type | Description | Since |
|---|---|---|---|
| ST_Contains | Boolean | Test whether geography A fully contains geography B. | v1.9.1 |
| ST_DWithin | Boolean | Test whether two geographies are within a given geodesic distance (in meters) of each other. | v1.9.1 |
| ST_Equals | Boolean | Test whether two geographies are spatially equal. | v1.9.1 |
| ST_Intersects | Boolean | Test whether two geographies intersect. | v1.9.1 |
| ST_Within | Boolean | Test whether geography A is fully within geography B. | v1.9.1 |