GeoSpatial Functions

For manipulating geospatial data, Pinot provides a set of functions for analyzing geometric components, determining spatial relationships, and manipulating geometries. In particular, geospatial functions that begin with the ST_ prefix support the SQL/MM specification.

Following geospatial functions are available out of the box in Pinot:

Aggregations

This aggregate function returns a MULTI geometry or NON-MULTI geometry from a set of geometries. it ignores NULL geometries.

Constructors

Returns a geometry type object from WKT representation, with the optional spatial system reference.

Returns a geometry type object from WKB representation.

Returns a geometry type point object with the given coordinate values.

Returns a geometry type polygon object from WKT representation.

Creates a geography instance from a Well-Known Binary geometry representation (WKB)

Returns a specified geography value from Well-Known Text representation or extended (WKT).

Measurements

ST_Area(Geometry/Geography g) → double

For geometry type, it returns the 2D Euclidean area of a geometry. For geography, returns the area of a polygon or multi-polygon in square meters using a spherical model for Earth.

For geometry type, returns the 2-dimensional cartesian minimum distance (based on spatial ref) between two geometries in projected units. For geography, returns the great-circle distance in meters between two SphericalGeography points. Note that g1, g2 shall have the same type.

Returns the type of the geometry as a string. e.g.: ST_Linestring, ST_Polygon,ST_MultiPolygon etc.

Outputs

Returns the WKB representation of the geometry.

Returns the WKT representation of the geometry/geography.

Conversion

Converts a Geometry object to a spherical geography object.

Converts a spherical geographical object to a Geometry object.

Relationship

Returns true if and only if no points of the second geometry/geography lie in the exterior of the first geometry/geography, and at least one point of the interior of the first geometry lies in the interior of the second geometry. Warning: ST_Contains on Geography only give close approximation

ST_Equals(Geometry, Geometry) → boolean

Returns true if the given geometries represent the same geometry/geography.

ST_Within(Geometry, Geometry) → boolean

Returns true if first geometry is completely inside second geometry.

Last updated

Was this helpful?