DeltaForge
/
Documentation
/
Spatial Functions
Spatial Functions
PostGIS-style geospatial functions and Uber H3 hexagonal indexing exposed directly as SQL.
Geospatial
ST_AREA
Compute the planar area of a polygon or multipolygon geometry in the units of its coordinate system.
ST_AS_TEXT
Serialize a geometry to its Well-Known Text (WKT) representation.
ST_AZIMUTH
Compute the initial azimuth in radians from one point to another on a spherical Earth.
ST_BEARING
Compute the initial great-circle bearing in compass degrees from one point to another on a spherical Earth.
ST_CONTAINS
Test whether the first geometry completely contains the second geometry.
ST_DISTANCE
Compute the planar Euclidean distance between two geometries in the units of their coordinate system.
ST_DISTANCE_HAVERSINE
Compute the great-circle distance between two points on a spherical Earth using the Haversine formula.
ST_DISTANCE_SPHERE
Compute the great-circle distance between two points on a spherical Earth using the spherical law of cosines.
ST_DISTANCE_VINCENTY
Compute the geodesic distance between two points on the WGS 84 ellipsoid using Vincenty's inverse formula.
ST_FINAL_BEARING
Compute the final bearing in compass degrees at the destination of a great-circle path from one point to another.
ST_GEOM_FROM_TEXT
Parse a Well-Known Text (WKT) string into an internal geometry value.
ST_LENGTH
Compute the total planar length of a line or perimeter of a polygon in the units of the coordinate system.
ST_MAKE_POINT
Create a POINT geometry from numeric x and y coordinates.
ST_WITHIN
Test whether the first geometry lies completely inside the second geometry.
ST_X
Return the X coordinate of a POINT geometry.
ST_Y
Return the Y coordinate of a POINT geometry.
H3
H3_CELL_AREA
Return the exact surface area of an H3 cell in square meters on the WGS 84 ellipsoid.
H3_CELL_AREA_KM2
Return the exact surface area of an H3 cell in square kilometers on the WGS 84 ellipsoid.
H3_CELL_TO_BOUNDARY
Return the boundary of an H3 cell as a WKT POLYGON string.
H3_CELL_TO_CENTER_CHILD
Return the center child of an H3 cell at a finer resolution.
H3_CELL_TO_CHILDREN
Return all child cells of an H3 cell at a specified finer resolution.
H3_CELL_TO_LAT
Return the WGS 84 latitude of the center of an H3 cell.
H3_CELL_TO_LNG
Return the WGS 84 longitude of the center of an H3 cell.
H3_CELL_TO_PARENT
Return the H3 parent cell that contains a given cell at a coarser resolution.
H3_CELL_TO_STRING
Format an H3 cell index as its canonical 15 hexadecimal-digit string representation.
H3_CONTAINS_FAST
Test whether a coarser H3 cell contains a finer H3 cell using a fast hierarchical prefix check.
H3_EDGE_LENGTH
Return the average edge length of an H3 cell in meters for its resolution.
H3_GET_RESOLUTION
Return the H3 hierarchy resolution of a cell as an integer 0 through 15.
H3_GRID_DISTANCE
Return the grid distance between two H3 cells as an integer number of hex steps.
H3_GRID_PATH
Return the array of H3 cells on the shortest grid path from one cell to another.
H3_HEX_DISK
Return the array of H3 cells within k grid steps of a center cell, inclusive of the center.
H3_HEX_RING
Return the array of H3 cells on the ring exactly k grid steps from a center cell.
H3_IS_PENTAGON
Test whether an H3 cell is one of the 12 pentagon cells at its resolution.
H3_IS_RES_CLASS_III
Test whether an H3 cell is at a Class III (odd-numbered) resolution in the H3 hierarchy.
H3_IS_VALID_CELL
Test whether a BIGINT value encodes a valid H3 cell index.
H3_LATLNG_TO_CELL
Convert a latitude and longitude pair to the H3 cell index that contains the point at a given resolution.
H3_LATLNG_TO_CELL_FAST
Convert latitude and longitude to an H3 cell using a vectorized, multi-threaded batch path.
H3_POLYFILL
Return the H3 cells at a given resolution whose centers fall inside a WKT polygon.
H3_SPATIAL_JOIN_FAST
Test whether two H3 cells overlap (equal or one is an ancestor of the other) using a fast hierarchical check.
H3_STRING_TO_CELL
Parse an H3 cell string in canonical 15 hex-digit form into its BIGINT cell index.