Skip to content
🌵SedonaDB (Rust) 0.3.0 is out now, featuring larger-than-memory spatial joins, and row-level CRS!

Geometry Functions

The Geometry type in Sedona represents planar (2D Euclidean) spatial objects such as points, lines, and polygons. All coordinates are treated as Cartesian (x, y) values, and spatial operations — distance, area, intersection, etc. — use flat-plane math.

Geometry Constructors

These functions create geometry objects from various textual or binary formats, or from coordinate values.

Function Return type Description Since
ST_GeomCollFromText Geometry Constructs a GeometryCollection 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.6.1
ST_GeometryFromText Geometry Construct a Geometry from WKT. If SRID is not set, it defaults to 0 (unknown). Alias of ST_GeomFromWKT v1.6.1
ST_GeomFromEWKB Geometry Construct a Geometry from EWKB string or Binary. This function is an alias of ST_GeomFromWKB. v1.6.1
ST_GeomFromEWKT Geometry Construct a Geometry from OGC Extended WKT v1.5.0
ST_GeomFromGeoHash Geometry Create Geometry from geohash string and optional precision v1.2.1
ST_GeomFromGeoJSON Geometry Construct a Geometry from GeoJson v1.2.0
ST_GeomFromGML Geometry Construct a Geometry from GML. v1.3.0
ST_GeomFromKML Geometry Construct a Geometry from KML. v1.3.0
ST_GeomFromText Geometry Construct a Geometry from WKT. Alias of ST_GeomFromWKT v1.2.1
ST_GeomFromWKB Geometry Construct a Geometry from WKB string or Binary. This function also supports EWKB format. v1.2.0
ST_GeomFromWKT Geometry Construct a Geometry from WKT v1.2.0
ST_LineFromText Geometry Construct a LineString from Text v1.2.1
ST_LineFromWKB Geometry Construct a LineString geometry from WKB string or Binary and an optional SRID. This function also supports EWKB format. v1.6.1
ST_LineStringFromText Geometry Construct a LineString from Text, delimited by Delimiter (Optional). Alias of ST_LineFromText v1.2.1
ST_LinestringFromWKB Geometry Construct a LineString geometry from WKB string or Binary and an optional SRID. This function also supports EWKB format and it is an alias of ST_LineFromWKB. v1.6.1
ST_MakeEnvelope Geometry Construct a Polygon from MinX, MinY, MaxX, MaxY, and an optional SRID. v1.7.0
ST_MakePoint Geometry Creates a 2D, 3D Z or 4D ZM Point geometry. Use ST_MakePointM to make points with XYM coordinates. Z and M values are optional. v1.5.0
ST_MakePointM Geometry Creates a point with X, Y, and M coordinate. Use ST_MakePoint to make points with XY, XYZ, or XYZM coordinates. v1.6.1
ST_MLineFromText Geometry Construct a MultiLineString from Text and Optional SRID
ST_MPointFromText Geometry Constructs a MultiPoint 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 MULTIPOINT. v1.6.1
ST_MPolyFromText Geometry Construct a MultiPolygon from Text and Optional SRID
ST_Point Geometry Construct a Point from X and Y v1.2.1
ST_PointFromGeoHash Geometry Generates a Point geometry representing the center of the GeoHash cell defined by the input string. If precision is not specified, the full GeoHash precision is used. Providing a precision value... v1.6.1
ST_PointFromText Geometry Construct a Point from Text, delimited by Delimiter v1.2.0
ST_PointFromWKB Geometry Construct a Point geometry from WKB string or Binary and an optional SRID. This function also supports EWKB format. v1.6.1
ST_PointM Geometry Construct a Point from X, Y and M and an optional srid. If srid is not set, it defaults to 0 (unknown). Must use ST_AsEWKT function to print the Z and M coordinates. v1.6.1
ST_PointZ Geometry Construct a Point from X, Y and Z and an optional srid. If srid is not set, it defaults to 0 (unknown). Must use ST_AsEWKT function to print the Z coordinate. v1.5.0
ST_PointZM Geometry Construct a Point from X, Y, Z, M and an optional srid. If srid is not set, it defaults to 0 (unknown). Must use ST_AsEWKT function to print the Z and M coordinates. v1.6.1
ST_PolygonFromEnvelope Geometry Construct a Polygon from MinX, MinY, MaxX, MaxY. v1.2.0
ST_PolygonFromText Geometry Construct a Polygon from Text, delimited by Delimiter. Path must be closed v1.2.0

Geometry Accessors

These functions extract information and properties from geometry objects.

Function Return type Description Since
GeometryType String Returns the type of the geometry as a string. Eg: 'LINESTRING', 'POLYGON', 'MULTIPOINT', etc. This function also indicates if the geometry is measured, by returning a string of the form 'POINTM'. v1.5.0
ST_Boundary Geometry Returns the closure of the combinatorial boundary of this Geometry. v1.3.0
ST_CoordDim Integer Returns the coordinate dimensions of the geometry. It is an alias of ST_NDims. v1.5.0
ST_CrossesDateLine Boolean This function determines if a given geometry crosses the International Date Line. It operates by checking if the difference in longitude between any pair of consecutive points in the geometry excee... v1.6.0
ST_Dimension Integer Return the topological dimension of this Geometry object, which must be less than or equal to the coordinate dimension. OGC SPEC s2.1.1.1 - returns 0 for POINT, 1 for LINESTRING, 2 for POLYGON, and... v1.5.0
ST_Dump Array<Geometry> It expands the geometries. If the geometry is simple (Point, Polygon Linestring etc.) it returns the geometry itself, if the geometry is collection or multi it returns record for each of collection... v1.5.0
ST_DumpPoints Array<Geometry> Returns list of Points which geometry consists of. v1.5.0
ST_EndPoint Geometry Returns last point of given linestring. v1.5.0
ST_ExteriorRing Geometry Returns a LINESTRING representing the exterior ring (shell) of a POLYGON. Returns NULL if the geometry is not a polygon. v1.2.1
ST_GeometryN Geometry Return the 0-based Nth geometry if the geometry is a GEOMETRYCOLLECTION, (MULTI)POINT, (MULTI)LINESTRING, MULTICURVE or (MULTI)POLYGON. Otherwise, return null v1.3.0
ST_GeometryType String Returns the type of the geometry as a string. EG: 'ST_Linestring', 'ST_Polygon' etc. v1.5.0
ST_HasM Boolean Checks for the presence of M coordinate values representing measures or linear references. Returns true if the input geometry includes an M coordinate, false otherwise. v1.6.1
ST_HasZ Boolean Checks for the presence of Z coordinate values representing measures or linear references. Returns true if the input geometry includes an Z coordinate, false otherwise. v1.6.1
ST_InteriorRingN Geometry Returns the Nth interior linestring ring of the polygon geometry. Returns NULL if the geometry is not a polygon or the given N is out of range v1.3.0
ST_IsClosed Boolean RETURNS true if the LINESTRING start and end point are the same. v1.3.0
ST_IsCollection Boolean Returns TRUE if the geometry type of the input is a geometry collection type. Collection types are the following: v1.5.0
ST_IsEmpty Boolean Test if a geometry is empty geometry v1.2.1
ST_IsPolygonCCW Boolean Returns true if all polygonal components in the input geometry have their exterior rings oriented counter-clockwise and interior rings oriented clockwise. v1.6.0
ST_IsPolygonCW Boolean Returns true if all polygonal components in the input geometry have their exterior rings oriented counter-clockwise and interior rings oriented clockwise. v1.6.0
ST_IsRing Boolean RETURN true if LINESTRING is ST_IsClosed and ST_IsSimple. v1.3.0
ST_IsSimple Boolean Test if geometry's only self-intersections are at boundary points. v1.3.0
ST_M Double Returns M Coordinate of given Point, null otherwise. v1.6.1
ST_NDims Integer Returns the coordinate dimension of the geometry. v1.3.1
ST_NPoints Integer Returns the number of points of the geometry v1.3.0
ST_NRings Integer Returns the number of rings in a Polygon or MultiPolygon. Contrary to ST_NumInteriorRings, this function also takes into account the number of exterior rings. v1.4.1
ST_NumGeometries Integer Returns the number of Geometries. If geometry is a GEOMETRYCOLLECTION (or MULTI*) return the number of geometries, for single geometries will return 1. v1.3.0
ST_NumInteriorRing Integer Returns number of interior rings of polygon geometries. It is an alias of ST_NumInteriorRings. v1.6.1
ST_NumInteriorRings Integer Returns number of interior rings of polygon geometries. v1.3.0
ST_NumPoints Integer Returns number of points in a LineString. v1.4.1
ST_PointN Geometry Return the Nth point in a single linestring or circular linestring in the geometry. Negative values are counted backwards from the end of the LineString, so that -1 is the last point. Returns NULL ... v1.2.1
ST_Points Geometry Returns a MultiPoint geometry consisting of all the coordinates of the input geometry. It preserves duplicate points as well as M and Z coordinates. v1.6.1
ST_StartPoint Geometry Returns first point of given linestring. v1.5.0
ST_X Double Returns X Coordinate of given Point, null otherwise. v1.3.0
ST_Y Double Returns Y Coordinate of given Point, null otherwise. v1.3.0
ST_Z Double Returns Z Coordinate of given Point, null otherwise. v1.3.0
ST_Zmflag Integer Returns a code indicating the Z and M coordinate dimensions present in the input geometry. v1.6.1

Geometry Editors

These functions create modified geometries by changing type, structure, or vertices.

Function Return type Description Since
ST_AddPoint Geometry Return Linestring with additional point at the given index, if position is not available the point will be added at the end of line. v1.3.0
ST_Collect Geometry Returns MultiGeometry object based on geometry column/s or array with geometries v1.5.0
ST_CollectionExtract Geometry Returns a homogeneous multi-geometry from a given geometry collection. v1.5.0
ST_FlipCoordinates Geometry Returns a version of the given geometry with X and Y axis flipped. v1.2.0
ST_Force2D Geometry Forces the geometries into a "2-dimensional mode" so that all output representations will only have the X and Y coordinates. This function is an alias of ST_Force_2D. v1.8.0
ST_Force3D Geometry Forces the geometry into a 3-dimensional model so that all output representations will have X, Y and Z coordinates. An optionally given zValue is tacked onto the geometry if the geometry is 2-dimen... v1.4.1
ST_Force3DM Geometry Forces the geometry into XYM mode. Retains any existing M coordinate, but removes the Z coordinate if present. Assigns a default M value of 0.0 if mValue is not specified. v1.6.1
ST_Force3DZ Geometry Forces the geometry into a 3-dimensional model so that all output representations will have X, Y and Z coordinates. An optionally given zValue is tacked onto the geometry if the geometry is 2-dimen... v1.6.1
ST_Force4D Geometry Converts the input geometry to 4D XYZM representation. Retains original Z and M values if present. Assigning 0.0 defaults if mValue and zValue aren't specified. The output contains X, Y, Z, and... v1.6.1
ST_Force_2D Geometry Forces the geometries into a "2-dimensional mode" so that all output representations will only have the X and Y coordinates. This function is an alias of ST_Force2D. v1.2.1
ST_ForceCollection Geometry This function converts the input geometry into a GeometryCollection, regardless of the original geometry type. If the input is a multipart geometry, such as a MultiPolygon or MultiLineString, it wi... v1.6.1
ST_ForcePolygonCCW Geometry For (Multi)Polygon geometries, this function sets the exterior ring orientation to counter-clockwise and interior rings to clockwise orientation. Non-polygonal geometries are returned unchanged. v1.6.0
ST_ForcePolygonCW Geometry For (Multi)Polygon geometries, this function sets the exterior ring orientation to clockwise and interior rings to counter-clockwise orientation. Non-polygonal geometries are returned unchanged. v1.6.0
ST_ForceRHR Geometry Sets the orientation of polygon vertex orderings to follow the Right-Hand-Rule convention. The exterior ring will have a clockwise winding order, while any interior rings are oriented counter-clock... v1.6.1
ST_LineFromMultiPoint Geometry Creates a LineString from a MultiPoint geometry. v1.3.0
ST_LineMerge Geometry Returns a LineString or MultiLineString formed by sewing together the constituent line work of a MULTILINESTRING. v1.5.0
ST_LineSegments Array<Geometry> This function transforms a LineString containing multiple coordinates into an array of LineStrings, each with precisely two coordinates. The lenient argument, true by default, prevents an excepti... v1.7.1
ST_MakeLine Geometry Creates a LineString containing the points of Point, MultiPoint, or LineString geometries. Other geometry types cause an error. v1.5.0
ST_MakePolygon Geometry Function to convert closed linestring to polygon including holes. If holes are provided, they should be fully contained within the shell. Holes outside the shell will produce an invalid polygon (ma... v1.5.0
ST_Multi Geometry Returns a MultiGeometry object based on the geometry input. ST_Multi is basically an alias for ST_Collect with one geometry. v1.5.0
ST_Normalize Geometry Returns the input geometry in its normalized form. v1.3.0
ST_Polygon Geometry Function to create a polygon built from the given LineString and sets the spatial reference system from the srid v1.5.0
ST_Project Geometry Calculates a new point location given a starting point, distance, and azimuth. The azimuth indicates the direction, expressed in radians, and is measured in a clockwise manner starting from true no... v1.7.0
ST_RemovePoint Geometry Return Linestring with removed point at given index, position can be omitted and then last one will be removed. v1.3.0
ST_RemoveRepeatedPoints Geometry This function eliminates consecutive duplicate points within a geometry, preserving endpoints of LineStrings. It operates on (Multi)LineStrings, (Multi)Polygons, and MultiPoints, processing Geometr... v1.7.0
ST_Reverse Geometry Return the geometry with vertex order reversed v1.2.1
ST_Segmentize Geometry Returns a modified geometry having no segment longer than the given max_segment_length. v1.8.0
ST_SetPoint Geometry Replace Nth point of linestring with given point. Index is 0-based. Negative index are counted backwards, e.g., -1 is last point. v1.3.0
ST_ShiftLongitude Geometry Modifies longitude coordinates in geometries, shifting values between -180..0 degrees to 180..360 degrees and vice versa. This is useful for normalizing data across the International Date Line and ... v1.6.0

Geometry Output

These functions convert geometry objects into various textual or binary formats.

Function Return type Description Since
ST_AsBinary Binary Return the Well-Known Binary representation of a geometry v1.3.0
ST_AsEWKB Binary Return the Extended Well-Known Binary representation of a geometry. EWKB is an extended version of WKB which includes the SRID of the geometry. The format originated in PostGIS but is supported by ... v1.3.0
ST_AsEWKT String Return the Extended Well-Known Text representation of a geometry. EWKT is an extended version of WKT which includes the SRID of the geometry. The format originated in PostGIS but is supported by ma... v1.2.1
ST_AsGeoJSON String Return the GeoJSON string representation of a geometry. v1.6.1
ST_AsGML String Return the GML string representation of a geometry v1.3.0
ST_AsHEXEWKB String This function returns the input geometry encoded to a text representation in HEXEWKB format. The HEXEWKB encoding can use either little-endian (NDR) or big-endian (XDR) byte ordering. If no encoding... v1.6.1
ST_AsKML String Return the KML string representation of a geometry v1.3.0
ST_AsText String Return the Well-Known Text string representation of a geometry. It will support M coordinate if present since v1.5.0. v1.3.0
ST_GeoHash String Returns GeoHash of the geometry with given precision v1.2.0

Predicates

These functions test spatial relationships between geometries, returning boolean values.

Function Return type Description Since
ST_Contains Boolean Return true if A fully contains B v1.2.0
ST_CoveredBy Boolean Return true if A is covered by B v1.3.0
ST_Covers Boolean Return true if A covers B v1.3.0
ST_Crosses Boolean Return true if A crosses B v1.5.0
ST_Disjoint Boolean Return true if A and B are disjoint v1.2.1
ST_DWithin Boolean Returns true if 'leftGeometry' and 'rightGeometry' are within a specified 'distance'. v1.5.1
ST_Equals Boolean Return true if A equals to B v1.5.0
ST_Intersects Boolean Return true if A intersects B v1.2.0
ST_OrderingEquals Boolean Returns true if the geometries are equal and the coordinates are in the same order v1.2.1
ST_Overlaps Boolean Return true if A overlaps B v1.5.0
ST_Relate String The first variant of the function computes and returns the Dimensionally Extended 9-Intersection Model (DE-9IM) matrix string representing the spatial relati... v1.6.1
ST_RelateMatch Boolean This function tests the relationship between two Dimensionally Extended 9-Intersection Model (DE-9IM) matrices representing geometry intersections. It evalua... v1.6.1
ST_Touches Boolean Return true if A touches B v1.5.0
ST_Within Boolean Return true if A is within B v1.3.0

Measurement Functions

These functions compute measurements of distance, area, length, and angles.

Function Return type Description Since
ST_3DDistance Double Return the 3-dimensional minimum cartesian distance between A and B v1.3.0
ST_Angle Double Compute and return the angle between two vectors represented by the provided points or linestrings. v1.5.0
ST_Area Double Return the area of A v1.3.0
ST_AreaSpheroid Double Return the geodesic area of A using WGS84 spheroid. Unit is meter. Works better for large geometries (country level) compared to ST_Area + ST_Transform. It is equivalent to PostGIS `ST_Area(geo... v1.4.1
ST_Azimuth Double Returns Azimuth for two given points in radians. Returns null if the two points are identical. v1.3.0
ST_ClosestPoint Geometry Returns the 2-dimensional point on geom1 that is closest to geom2. This is the first point of the shortest line between the geometries. If using 3D geometries, the Z coordinates will be ignored. If... v1.5.0
ST_Degrees Double Convert an angle in radian to degrees. v1.5.0
ST_Distance Double Return the Euclidean distance between A and B v1.2.0
ST_DistanceSphere Double Return the haversine / great-circle distance of A using a given earth radius (default radius: 6371008.0). Unit is meter. Works better for large geometries (country level) compared to ST_Distance ... v1.4.1
ST_DistanceSpheroid Double Return the geodesic distance of A using WGS84 spheroid. Unit is meter. Works better for large geometries (country level) compared to ST_Distance + ST_Transform. It is equivalent to PostGIS `ST_... v1.4.1
ST_FrechetDistance Double Computes and returns discrete Frechet Distance between the given two geometries, based on [Computing Discrete Frechet Distance](http://www.kr.... v1.5.0
ST_HausdorffDistance Double Returns a discretized (and hence approximate) Hausdorff distance between the given 2 geometries. Optionally, a densityFraction parameter can be s... v1.5.0
ST_Length Double Returns the perimeter of A. v1.3.0
ST_Length2D Double Returns the perimeter of A. This function is an alias of ST_Length. v1.6.1
ST_LengthSpheroid Double Return the geodesic perimeter of A using WGS84 spheroid. Unit is meter. Works better for large geometries (country level) compared to ST_Length + ST_Transform. It is equivalent to PostGIS `ST_L... v1.4.1
ST_LongestLine Geometry Returns the LineString geometry representing the maximum distance between any two points from the input geometries. v1.6.1
ST_MaxDistance Double Calculates and returns the length value representing the maximum distance between any two points across the input geometries. This function is an alias for ST_LongestDistance. v1.6.1
ST_MinimumClearance Double The minimum clearance is a metric that quantifies a geometry's tolerance to changes in coordinate precision or vertex positions. It represents the maximum distance by which vertices can be adjusted... v1.6.1
ST_MinimumClearanceLine Geometry This function returns a two-point LineString geometry representing the minimum clearance distance of the input geometry. If the input geometry does not have a defined minimum clearance, such as for... v1.6.1
ST_Perimeter Double This function calculates the 2D perimeter of a given geometry. It supports Polygon, MultiPolygon, and GeometryCollection geometries (as long as the GeometryCollection contains polygonal geometries)... v1.7.0
ST_Perimeter2D Double This function calculates the 2D perimeter of a given geometry. It supports Polygon, MultiPolygon, and GeometryCollection geometries (as long as the GeometryCollection contains polygonal geometries)... v1.7.1

Geometry Processing

These functions compute geometric constructions, or alter geometry size or shape.

Function Return type Description Since
ST_ApproximateMedialAxis Geometry Computes an approximate medial axis of a polygonal geometry. The medial axis is a representation of the "centerline" or "skeleton" of the polygon. This function first computes the straight skeleton... v1.8.0
ST_Buffer Geometry Returns a geometry/geography that represents all points whose distance from this Geometry/geography is less than or equal to distance. The function supports both Planar/Euclidean and Spheroidal/Geo... v1.6.0
ST_BuildArea Geometry Returns the areal geometry formed by the constituent linework of the input geometry. v1.2.1
ST_Centroid Geometry Return the centroid point of A v1.5.0
ST_ConcaveHull Geometry Return the Concave Hull of polygon A, with alpha set to pctConvex[0, 1] in the Delaunay Triangulation method, the concave hull will not contain a hole unless allowHoles is set to true v1.4.0
ST_ConvexHull Geometry Return the Convex Hull of polygon A v1.5.0
ST_DelaunayTriangles Geometry This function computes the Delaunay triangulation for the set of vertices in the input geometry. An optional tolerance parameter allows sna... v1.6.1
ST_GeneratePoints Geometry Generates a specified quantity of pseudo-random points within the boundaries of the provided polygonal geometry. When seed is either zero or not defined then output will be random. v1.6.1
ST_GeometricMedian Geometry Computes the approximate geometric median of a MultiPoint geometry using the Weiszfeld algorithm. The geometric median provides a centrality measure that is less sensitive to outlier points than th... v1.4.1
ST_LabelPoint Geometry ST_LabelPoint computes and returns a label point for a given polygon or geometry collection. The label point is chosen to be sufficiently far from boundaries of the geometry. For a regular Polygo... v1.7.1
ST_MinimumBoundingCircle Geometry Returns the smallest circle polygon that contains a geometry. The optional quadrantSegments parameter determines how many segments to use per quadrant and the default number of segments is 48. v1.5.0
ST_MinimumBoundingRadius Struct Returns a struct containing the center point and radius of the smallest circle that contains a geometry. v1.5.0
ST_OrientedEnvelope Geometry Returns the minimum-area rotated rectangle enclosing a geometry. The rectangle may be rotated relative to the coordinate axes. Degenerate inputs may result in a Point or LineString being returned. v1.8.1
ST_PointOnSurface Geometry Returns a POINT guaranteed to lie on the surface. v1.2.1
ST_Polygonize Geometry Generates a GeometryCollection composed of polygons that are formed from the linework of an input GeometryCollection. When the input does not contain any linework that forms a polygon, the function... v1.6.0
ST_ReducePrecision Geometry Reduce the decimals places in the coordinates of the geometry to the given number of decimal places. The last decimal place will be rounded. v1.5.0
ST_Simplify Geometry This function simplifies the input geometry by applying the Douglas-Peucker algorithm. v1.7.0
ST_SimplifyPolygonHull Geometry This function computes a topology-preserving simplified hull, either outer or inner, for a polygonal geometry input. An outer hull fully encloses the original geometry, while an inner hull lies ent... v1.6.1
ST_SimplifyPreserveTopology Geometry Simplifies a geometry and ensures that the result is a valid geometry having the same dimension and number of components as the input, and with the components having the same topological relationship. v1.5.0
ST_SimplifyVW Geometry This function simplifies the input geometry by applying the Visvalingam-Whyatt algorithm. v1.6.1
ST_Snap Geometry Snaps the vertices and segments of the input geometry to reference geometry within the specified tolerance distance. The tolerance parameter controls the maximum snap distance. v1.6.0
ST_StraightSkeleton Geometry Computes the straight skeleton of a polygonal geometry. The straight skeleton is a method of representing a polygon by a topological skeleton, formed by a continuous shrinking process where each ed... v1.8.0
ST_TriangulatePolygon Geometry Generates the constrained Delaunay triangulation for the input Polygon. The constrained Delaunay triangulation is a set of triangles created from the Polygon's vertices that covers the Polygon area... v1.6.1
ST_VoronoiPolygons Geometry Returns a two-dimensional Voronoi diagram from the vertices of the supplied geometry. The result is a GeometryCollection of Polygons that covers an envelope larger than the extent of the input vert... v1.5.0

Overlay Functions

These functions compute results arising from the overlay of two geometries. These are also known as point-set theoretic boolean operations.

Function Return type Description Since
ST_Difference Geometry Return the difference between geometry A and B (return part of geometry A that does not intersect geometry B) v1.5.0
ST_Intersection Geometry Return the intersection geometry of A and B v1.5.0
ST_SubDivide Array<Geometry> Returns list of geometries divided based of given maximum number of vertices. v1.5.0
ST_SymDifference Geometry Return the symmetrical difference between geometry A and B (return parts of geometries which are in either of the sets, but not in their intersection) v1.5.0
ST_UnaryUnion Geometry This variant of ST_Union operates on a single geometry input. The input geometry can be a simple Geometry type, a MultiGeometry, or a GeometryCollection. The function calculates the ge... v1.6.1
ST_Union Geometry Variant 1: Return the union of geometry A and B. v1.6.0

Affine Transformations

These functions change the position and shape of geometries using affine transformations.

Function Return type Description Since
ST_Affine Geometry Apply an affine transformation to the given geometry. v1.5.0
ST_Rotate Geometry Rotates a geometry by a specified angle in radians counter-clockwise around a given origin point. The origin for rotation can be specified as either a POINT geometry or x and y coordinates. If the ... v1.6.1
ST_RotateX Geometry Performs a counter-clockwise rotation of the specified geometry around the X-axis by the given angle measured in radians. v1.6.1
ST_RotateY Geometry Performs a counter-clockwise rotation of the specified geometry around the Y-axis by the given angle measured in radians. v1.7.0
ST_Scale Geometry This function scales the geometry to a new size by multiplying the ordinates with the corresponding scaling factors provided as parameters scaleX and scaleY. v1.7.0
ST_ScaleGeom Geometry This function scales the input geometry (geometry) to a new size. It does this by multiplying the coordinates of the input geometry with corresponding values from another geometry (factor) repr... v1.7.0
ST_Translate Geometry Returns the input geometry with its X, Y and Z coordinates (if present in the geometry) translated by deltaX, deltaY and deltaZ (if specified) v1.4.1

Aggregate Functions

These functions perform aggregate operations on groups of geometries.

Function Return type Description Since
ST_Envelope_Agg Geometry Return the entire envelope boundary of all geometries in A. Empty geometries and null values are skipped. If all inputs are empty or null, the result is null. This behavior is consistent with PostG... v1.3.0
ST_Intersection_Agg Geometry Return the polygon intersection of all polygons in A v1.5.0
ST_Union_Agg Geometry Return the polygon union of all polygons in A. All inputs must be polygons. v1.3.0

Linear Referencing

These functions work with linear referencing, measures along lines, and trajectory data.

Function Return type Description Since
ST_AddMeasure Geometry Computes a new geometry with measure (M) values linearly interpolated between start and end points. For geometries lacking M dimensions, M values are added. Existing M values are overwritten by the... v1.6.1
ST_InterpolatePoint Double Returns the interpolated measure value of a linear measured LineString at the point closest to the specified point. v1.7.0
ST_IsValidTrajectory Boolean This function checks if a geometry is a valid trajectory representation. For a trajectory to be considered valid, it must be a LineString that includes measure (M) values. The key requirement is th... v1.6.1
ST_LineInterpolatePoint Geometry Returns a point interpolated along a line. First argument must be a LINESTRING. Second argument is a Double between 0 and 1 representing fraction of total linestring length the point has to be loca... v1.5.0
ST_LineLocatePoint Double Returns a double between 0 and 1, representing the location of the closest point on the LineString as a fraction of its total length. The first argument must be a LINESTRING, and the second argument... v1.5.1
ST_LineSubstring Geometry Return a linestring being a substring of the input one starting and ending at the given fractions of total 2d length. Second and third arguments are Double values between 0 and 1. This only works w... v1.5.0
ST_LocateAlong Geometry This function computes Point or MultiPoint geometries representing locations along a measured input geometry (LineString or MultiLineString) corresponding to the provided measure value(s). Polygona... v1.6.1

Spatial Reference System

These functions work with the Spatial Reference System of geometries.

Function Return type Description Since
ST_BestSRID Integer Returns the estimated most appropriate Spatial Reference Identifier (SRID) for a given geometry, based on its spatial extent and location. It evaluates the geometry's bounding envelope and selects ... v1.6.0
ST_SetSRID Geometry Sets the spatial reference system identifier (SRID) of the geometry. v1.3.0
ST_SRID Integer Return the spatial reference system identifier (SRID) of the geometry. v1.3.0
ST_Transform Geometry Transform the Spatial Reference System / Coordinate Reference System of A, from SourceCRS to TargetCRS. v1.2.0

Geometry Validation

These functions test whether geometries are valid and can repair invalid geometries.

Function Return type Description Since
ST_IsValid Boolean Test if a geometry is well-formed. The function can be invoked with just the geometry or with an additional flag (from v1.5.1). The flag alters the validity checking behavior. The flags parameter... v1.0.0
ST_IsValidReason String Returns text stating if the geometry is valid. If not, it provides a reason why it is invalid. The function can be invoked with just the geometry or with an additional flag. The flag alters the val... v1.5.1
ST_MakeValid Geometry Given an invalid geometry, create a valid representation of the geometry. v1.5.0

Bounding Box Functions

These functions produce or operate on bounding boxes and compute extent values.

Function Return type Description Since
ST_BoundingDiagonal Geometry Returns a linestring spanning minimum and maximum values of each dimension of the given geometry's coordinates as its start and end point respectively. If an empty geometry is provided, the returned... v1.5.0
ST_Envelope Geometry Return the envelope boundary of A v1.3.0
ST_Expand Geometry Returns a geometry expanded from the bounding box of the input. The expansion can be specified in two ways: v1.6.1
ST_MMax Double Returns M maxima of the given geometry or null if there is no M coordinate. v1.6.1
ST_MMin Double Returns M minima of the given geometry or null if there is no M coordinate. v1.6.1
ST_XMax Double Returns the maximum X coordinate of a geometry v1.2.1
ST_XMin Double Returns the minimum X coordinate of a geometry v1.2.1
ST_YMax Double Return the minimum Y coordinate of A v1.2.1
ST_YMin Double Return the minimum Y coordinate of A v1.2.1
ST_ZMax Double Returns Z maxima of the given geometry or null if there is no Z coordinate. v1.3.1
ST_ZMin Double Returns Z minima of the given geometry or null if there is no Z coordinate. v1.3.1

Spatial Indexing

These functions work with spatial indexing systems including Bing Tiles, H3, S2, and GeoHash.

Function Return type Description Since
ST_BingTile String Creates a Bing Tile quadkey from tile XY coordinates and a zoom level. v1.9.0
ST_BingTileAt String Returns the Bing Tile quadkey for a given point (longitude, latitude) at a specified zoom level. v1.9.0
ST_BingTileCellIDs Array<String> Returns an array of Bing Tile quadkey strings that cover the given geometry at the specified zoom level. v1.9.0
ST_BingTilePolygon Geometry Returns the bounding polygon (Geometry) of the Bing Tile identified by the given quadkey. v1.9.0
ST_BingTilesAround Array<String> Returns an array of Bing Tile quadkey strings representing the neighborhood tiles around the tile that contains the given point (longitude, latitude) at the specified zoom level. Returns the 3×3 ne... v1.9.0
ST_BingTileToGeom Array<Geometry> Returns an array of Polygons for the corresponding Bing Tile quadkeys. v1.9.0
ST_BingTileX Integer Returns the tile X coordinate of the Bing Tile identified by the given quadkey. v1.9.0
ST_BingTileY Integer Returns the tile Y coordinate of the Bing Tile identified by the given quadkey. v1.9.0
ST_BingTileZoomLevel Integer Returns the zoom level of the Bing Tile identified by the given quadkey. v1.9.0
ST_GeoHashNeighbor String Returns the neighbor geohash cell in the given direction. Valid directions are: n, ne, e, se, s, sw, w, nw (case-insensitive). v1.9.0
ST_GeoHashNeighbors Array<String> Returns the 8 neighboring geohash cells of a given geohash string. The result is an array of 8 geohash strings in the order: N, NE, E, SE, S, SW, W, NW. v1.9.0
ST_H3CellDistance Long return result of h3 function gridDistance(cel1, cell2). As described by H3 documentation > Finding the distance can fail because the two indexes... v1.5.0
ST_H3CellIDs Array<Long> Cover the geometry by H3 cell IDs with the given resolution(level). To understand the cell statistics please refer to H3 Doc H3 native fill functions... v1.5.0
ST_H3KRing Array<Long> return the result of H3 function gridDisk(cell, k). v1.5.0
ST_H3ToGeom Array<Geometry> Return the result of H3 function cellsToMultiPolygon(cells). v1.6.0
ST_S2CellIDs Array<Long> Cover the geometry with Google S2 Cells, return the corresponding cell IDs with the given level. The level indicates the size of cells. With... v1.4.0
ST_S2ToGeom Array<Geometry> Returns an array of Polygons for the corresponding S2 cell IDs. v1.6.0