Exasol implements a subset of the geometry types, methods and functions of the ISO/IEC 13249-3:2016 Information technology -- Database languages -- SQL multimedia and application packages -- Part 3: Spatial standard.
Various additonal geospatial functions have been produced as SQL function or as UDF to extend the coverage.
NOTE: Function overloading in Exasol SQL is not supported. Since a GEOMETRY
datatype without spatial reference is a different from a GEOMETRY
datatype with geospatial reference (e.g. GEOMETRY(4326)
), separate functions are required to serve the different data types (used as input parameters). This file contains implementations for GEOMETRY
datatype without spatial reference and with World Geodetic System (WGS 1984 / EPSG:432) spatial reference. You will need to adjust the function definitions if you need to use a different spatial reference. The list of supported spatial references can be found in the EXA_SPATIAL_REF_SYS table.
NOTE: Exasol stores geomatry objects internally as Well-Known Text (WKT), practically as VARCHAR(2000000)
with the spatial reference metadata.
- Geometry constructors
ST_Point
: Returns anST_Point
with the given coordinate values.ST_WKTToSQL
/ST_GeomFromText
: Returns a specifiedST_Geometr
y value from WKT.
- Geometry accessors
ST_XMax
/ST_MaxX
: Returns X maxima of the bounding box of a geometry (asFLOAT
).ST_XMin
/ST_MinX
: Returns X minima of the bounding box of a geometry (asFLOAT
).ST_YMax
/ST_MaxY
: Returns Y maxima of the bounding box of a geometry (asFLOAT
).ST_YMin
/ST_MinY
: Returns Y minima of the bounding box of a geometry (asFLOAT
).
- Geometry outputs
ST_AsText
: Returns the WKT representation of the geometry/geography without SRID metadata.
The above functions with GEOMETRY(4326)
are implemented as *WGS (e.g. ST_MinXWGS
).
Implementation of the Haversine formula to the great-circle distance between two points on a sphere given their longitudes and latitudes. It uses World Geodetic System (WGS 1984 / EPSG:432) spatial reference.
Generates a WKT output from a GeoJSON input.