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.

FunctionDescription
ST_GeomCollFromTextConstructs 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.
ST_GeometryFromTextConstruct a Geometry from WKT. If SRID is not set, it defaults to 0 (unknown). Alias of ST_GeomFromWKT
ST_GeomFromEWKBConstruct a Geometry from EWKB string or Binary. This function is an alias of ST_GeomFromWKB.
ST_GeomFromEWKTConstruct a Geometry from OGC Extended WKT
ST_GeomFromGeoHashCreate Geometry from geohash string and optional precision
ST_GeomFromGeoJSONConstruct a Geometry from GeoJson
ST_GeomFromGMLConstruct a Geometry from GML.
ST_GeomFromKMLConstruct a Geometry from KML.
ST_GeomFromTextConstruct a Geometry from WKT. If SRID is not set, it defaults to 0 (unknown). Alias of ST_GeomFromWKT
ST_GeomFromWKBConstruct a Geometry from WKB string or Binary. This function also supports EWKB format.
ST_GeomFromWKTConstruct a Geometry from WKT. If SRID is not set, it defaults to 0 (unknown).
ST_LineFromTextConstruct a Line from Wkt text
ST_LineFromWKBConstruct a LineString geometry from WKB string or Binary and an optional SRID. This function also supports EWKB format.
ST_LineStringFromTextConstruct a LineString from Text, delimited by Delimiter
ST_LinestringFromWKBConstruct 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.
ST_MakeEnvelopeConstruct a Polygon from MinX, MinY, MaxX, MaxY, and an optional SRID.
ST_MakePointCreates a 2D, 3D Z or 4D ZM Point geometry. Use ST_MakePointM to make points with XYM coordinates. Z and M values are optional.
ST_MLineFromTextConstruct a MultiLineString from Wkt. If srid is not set, it defaults to 0 (unknown).
ST_MPointFromTextConstructs 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.
ST_MPolyFromTextConstruct a MultiPolygon from Wkt. If srid is not set, it defaults to 0 (unknown).
ST_PointConstruct a Point from X and Y
ST_PointFromGeoHashGenerates 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...
ST_PointFromTextConstruct a Point from Text, delimited by Delimiter
ST_PointFromWKBConstruct a Point geometry from WKB string or Binary and an optional SRID. This function also supports EWKB format.
ST_PointZConstruct 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.
ST_PointZConstruct 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.
ST_PolygonFromEnvelopeConstruct a Polygon from MinX, MinY, MaxX, MaxY.
ST_PolygonFromTextConstruct a Polygon from Text, delimited by Delimiter. Path must be closed

Geometry Accessors

These functions extract information and properties from geometry objects.

FunctionDescription
GeometryTypeReturns 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’.
ST_BoundaryReturns the closure of the combinatorial boundary of this Geometry.
ST_CoordDimReturns the coordinate dimensions of the geometry. It is an alias of ST_NDims.
ST_CrossesDateLineThis 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...
ST_DimensionReturn 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...
ST_DumpThis function takes a GeometryCollection/Multi Geometry object and returns a set of geometries containing the individual geometries that make up the input geometry. The function is useful for break...
ST_DumpPointsReturns a MultiPoint geometry which consists of individual points that compose the input line string.
ST_EndPointReturns last point of given linestring.
ST_ExteriorRingReturns a line string representing the exterior ring of the POLYGON geometry. Return NULL if the geometry is not a polygon.
ST_GeometryNReturn the 0-based Nth geometry if the geometry is a GEOMETRYCOLLECTION, (MULTI)POINT, (MULTI)LINESTRING, MULTICURVE or (MULTI)POLYGON. Otherwise, return null
ST_GeometryTypeReturns the type of the geometry as a string. EG: ‘ST_Linestring’, ‘ST_Polygon’ etc.
ST_HasZChecks for the presence of Z coordinate values representing measures or linear references. Returns true if the input geometry includes an Z coordinate, false otherwise.
ST_InteriorRingNReturns 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
ST_IsClosedRETURNS true if the LINESTRING start and end point are the same.
ST_IsCollectionReturns TRUE if the geometry type of the input is a geometry collection type. Collection types are the following:
ST_IsEmptyTest if a geometry is empty geometry
ST_IsPolygonCCWReturns true if all polygonal components in the input geometry have their exterior rings oriented counter-clockwise and interior rings oriented clockwise.
ST_IsPolygonCWReturns true if all polygonal components in the input geometry have their exterior rings oriented counter-clockwise and interior rings oriented clockwise.
ST_IsRingRETURN true if LINESTRING is ST_IsClosed and ST_IsSimple.
ST_IsSimpleTest if geometry's only self-intersections are at boundary points.
ST_NDimsReturns the coordinate dimension of the geometry.
ST_NPointsReturn points of the geometry
ST_NRingsReturns the number of rings in a Polygon or MultiPolygon. Contrary to ST_NumInteriorRings, this function also takes into account the number of exterior rings.
ST_NumGeometriesReturns the number of Geometries. If geometry is a GEOMETRYCOLLECTION (or MULTI*) return the number of geometries, for single geometries will return 1.
ST_NumInteriorRingReturns number of interior rings of polygon geometries. It is an alias of ST_NumInteriorRings.
ST_NumInteriorRingsRETURNS number of interior rings of polygon geometries.
ST_NumPointsReturns number of points in a LineString
ST_PointNReturn 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 ...
ST_PointsReturns a MultiPoint geometry consisting of all the coordinates of the input geometry. It preserves duplicate points as well as M and Z coordinates.
ST_StartPointReturns first point of given linestring.
ST_XReturns X Coordinate of given Point null otherwise.
ST_YReturns Y Coordinate of given Point, null otherwise.
ST_ZReturns Z Coordinate of given Point, null otherwise.

Geometry Editors

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

FunctionDescription
ST_AddPointRETURN Linestring with additional point at the given index, if position is not available the point will be added at the end of line.
ST_CollectBuild an appropriate Geometry, MultiGeometry, or GeometryCollection to contain the Geometrys in it. For example:
ST_CollectionExtractReturns a homogeneous multi-geometry from a given geometry collection.
ST_FlipCoordinatesReturns a version of the given geometry with X and Y axis flipped.
ST_Force2DForces 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.
ST_Force3DForces 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...
ST_Force3DZForces 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...
ST_Force_2DForces 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.
ST_ForceCollectionThis 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...
ST_ForcePolygonCCWFor (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.
ST_ForcePolygonCWFor (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.
ST_ForceRHRSets 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...
ST_LineFromMultiPointCreates a LineString from a MultiPoint geometry.
ST_LineMergeReturns a LineString or MultiLineString formed by sewing together the constituent line work of a MULTILINESTRING.
ST_MakeLineCreates a LineString containing the points of Point, MultiPoint, or LineString geometries. Other geometry types cause an error.
ST_MakePolygonFunction to convert closed linestring to polygon including holes. The holes must be a MultiLinestring. If holes are provided, they should be fully contained within the shell. Holes outside the shel...
ST_MultiReturns a MultiGeometry object based on the geometry input. ST_Multi is basically an alias for ST_Collect with one geometry.
ST_NormalizeReturns the input geometry in its normalized form.
ST_PolygonFunction to create a polygon built from the given LineString and sets the spatial reference system from the srid
ST_ProjectCalculates 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...
ST_RemovePointRETURN Line with removed point at given index, position can be omitted and then last one will be removed.
ST_RemoveRepeatedPointsThis function eliminates consecutive duplicate points within a geometry, preserving endpoints of LineStrings. It operates on (Multi)LineStrings, (Multi)Polygons, and MultiPoints, processing Geometr...
ST_ReverseReturn the geometry with vertex order reversed
ST_SegmentizeReturns a modified geometry having no segment longer than the given max_segment_length.
ST_SetPointReplace Nth point of linestring with given point. Index is 0-based. Negative index are counted backwards, e.g., -1 is last point.
ST_ShiftLongitudeModifies 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 ...

Geometry Output

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

FunctionDescription
ST_AsBinaryReturn the Well-Known Binary representation of a geometry
ST_AsEWKBReturn 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 ...
ST_AsEWKTReturn 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...
ST_AsGeoJSONReturn the GeoJSON string representation of a geometry
ST_AsGMLReturn the GML string representation of a geometry
ST_AsHEXEWKBThis 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...
ST_AsKMLReturn the KML string representation of a geometry
ST_AsTextReturn the Well-Known Text string representation of a geometry
ST_GeoHashReturns GeoHash of the geometry with given precision

Predicates

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

FunctionDescription
ST_ContainsReturn true if A fully contains B
ST_CoveredByReturn true if A is covered by B
ST_CoversReturn true if A covers B
ST_CrossesReturn true if A crosses B
ST_DisjointReturn true if A and B are disjoint
ST_DWithinReturns true if ‘leftGeometry’ and ‘rightGeometry’ are within a specified ‘distance’. This function essentially checks if the shortest distance between the envelope of the two geometries is <= the ...
ST_EqualsReturn true if A equals to B
ST_IntersectsReturn true if A intersects B
ST_OrderingEqualsReturns true if the geometries are equal and the coordinates are in the same order
ST_OverlapsReturn true if A overlaps B
ST_RelateThe first variant of the function computes and returns the Dimensionally Extended 9-Intersection Model (DE-9IM) matrix string representing the spatial relati...
ST_RelateMatchThis function tests the relationship between two Dimensionally Extended 9-Intersection Model (DE-9IM) matrices representing geometry intersections. It evalua...
ST_TouchesReturn true if A touches B
ST_WithinReturn true if A is fully contained by B

Measurement Functions

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

FunctionDescription
ST_3DDistanceReturn the 3-dimensional minimum cartesian distance between A and B
ST_AngleComputes and returns the angle between two vectors represented by the provided points or linestrings.
ST_AreaReturn the area of A
ST_AreaSpheroidReturn the geodesic area of A using WGS84 spheroid. Unit is square meter. Works better for large geometries (country level) compared to ST_Area + ST_Transform. It is equivalent to PostGIS `ST_A...
ST_AzimuthReturns Azimuth for two given points in radians. Returns null if the two points are identical.
ST_ClosestPointReturns 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...
ST_DegreesConvert an angle in radian to degrees.
ST_DistanceReturn the Euclidean distance between A and B
ST_DistanceSphereReturn the haversine / great-circle distance of A using a given earth radius (default radius: 6371008.0). Unit is meter. Compared to ST_Distance + ST_Transform, it works better for datasets that...
ST_DistanceSpheroidReturn the geodesic distance of A using WGS84 spheroid. Unit is meter. Compared to ST_Distance + ST_Transform, it works better for datasets that cover large regions such as continents or the en...
ST_FrechetDistanceComputes and returns discrete Frechet Distance between the given two geometries, based on [Computing Discrete Frechet Distance](http://www.kr....
ST_HausdorffDistanceReturns a discretized (and hence approximate) Hausdorff distance between the given 2 geometries. Optionally, a densityFraction parameter can be s...
ST_LengthReturns the perimeter of A.
ST_Length2DReturns the perimeter of A. This function is an alias of ST_Length.
ST_LengthSpheroidReturn 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...
ST_LongestLineReturns the LineString geometry representing the maximum distance between any two points from the input geometries.
ST_MaxDistanceCalculates 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.
ST_MinimumClearanceThe 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...
ST_MinimumClearanceLineThis 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...
ST_PerimeterThis function calculates the 2D perimeter of a given geometry. It supports Polygon, MultiPolygon, and GeometryCollection geometries (as long as the GeometryCollection contains polygonal geometries)...
ST_Perimeter2DThis function calculates the 2D perimeter of a given geometry. It supports Polygon, MultiPolygon, and GeometryCollection geometries (as long as the GeometryCollection contains polygonal geometries)...

Geometry Processing

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

FunctionDescription
ST_ApproximateMedialAxisComputes 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...
ST_BufferReturns 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...
ST_BuildAreaReturns the areal geometry formed by the constituent linework of the input geometry.
ST_CentroidReturn the centroid point of A
ST_ConcaveHullReturn 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
ST_ConvexHullReturn the Convex Hull of polygon A
ST_DelaunayTrianglesThis function computes the Delaunay triangulation for the set of vertices in the input geometry. An optional tolerance parameter allows sna...
ST_GeneratePointsGenerates 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.
ST_GeometricMedianComputes 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...
ST_LabelPointST_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...
ST_MaximumInscribedCircleFinds the largest circle that is contained within a (multi)polygon, or which does not overlap any lines and points. Returns a row with fields:
ST_MinimumBoundingCircleReturns the smallest circle polygon that contains a geometry.
ST_MinimumBoundingRadiusReturns two columns containing the center point and radius of the smallest circle that contains a geometry.
ST_OrientedEnvelopeReturns 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.
ST_PointOnSurfaceReturns a POINT guaranteed to lie on the surface.
ST_PolygonizeGenerates 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...
ST_ReducePrecisionReduce the decimals places in the coordinates of the geometry to the given number of decimal places. The last decimal place will be rounded. This function was called ST_PrecisionReduce in versions ...
ST_SimplifyThis function simplifies the input geometry by applying the Douglas-Peucker algorithm.
ST_SimplifyPolygonHullThis 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...
ST_SimplifyPreserveTopologySimplifies 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.
ST_SimplifyVWThis function simplifies the input geometry by applying the Visvalingam-Whyatt algorithm.
ST_SnapSnaps the vertices and segments of the input geometry to reference geometry within the specified tolerance distance. The tolerance parameter controls the maximum snap distance.
ST_StraightSkeletonComputes 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...
ST_TriangulatePolygonGenerates 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...
ST_VoronoiPolygonsReturns 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...

Overlay Functions

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

FunctionDescription
ST_DifferenceReturn the difference between geometry A and B (return part of geometry A that does not intersect geometry B)
ST_IntersectionReturn the intersection geometry of A and B
ST_SplitSplit an input geometry by another geometry (called the blade). Linear (LineString or MultiLineString) geometry can be split by a Point, MultiPoint, LineString, MultiLineString, Polygon, or MultiPo...
ST_SubDivideReturns a multi-geometry divided based of given maximum number of vertices.
ST_SubDivideExplodeIt works the same as ST_SubDivide but returns new rows with geometries instead of a multi-geometry.
ST_SymDifferenceReturn the symmetrical difference between geometry A and B (return parts of geometries which are in either of the sets, but not in their intersection)
ST_UnaryUnionThis 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...
ST_UnionReturn the union of geometry A and B

Affine Transformations

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

FunctionDescription
ST_AffineApply an affine transformation to the given geometry.
ST_RotateRotates 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 ...
ST_RotateXPerforms a counter-clockwise rotation of the specified geometry around the X-axis by the given angle measured in radians.
ST_RotateYPerforms a counter-clockwise rotation of the specified geometry around the Y-axis by the given angle measured in radians.
ST_ScaleThis function scales the geometry to a new size by multiplying the ordinates with the corresponding scaling factors provided as parameters scaleX and scaleY.
ST_ScaleGeomThis 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...
ST_TranslateReturns the input geometry with its X, Y and Z coordinates (if present in the geometry) translated by deltaX, deltaY and deltaZ (if specified)

Aggregate Functions

These functions perform aggregate operations on groups of geometries.

FunctionDescription
ST_Envelope_AggReturn 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...
ST_Intersection_AggReturn the polygon intersection of all polygons in A
ST_Union_AggReturn the polygon union of all polygons in A

Linear Referencing

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

FunctionDescription
ST_LineInterpolatePointReturns 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...
ST_LineLocatePointReturns 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...
ST_LineSubstringReturn 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...

Spatial Reference System

These functions work with the Spatial Reference System of geometries.

FunctionDescription
ST_BestSRIDReturns 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 ...
ST_SetSRIDSets the spatial reference system identifier (SRID) of the geometry.
ST_SRIDReturn the spatial reference system identifier (SRID) of the geometry.
ST_TransformTransform the Spatial Reference System / Coordinate Reference System of A, from SourceCRS to TargetCRS.

Geometry Validation

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

FunctionDescription
ST_IsValidTest 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...
ST_IsValidDetailReturns a row, containing a boolean valid stating if a geometry is valid, a string reason stating why it is invalid and a geometry location pointing out where it is invalid.
ST_IsValidReasonReturns 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...
ST_MakeValidGiven an invalid geometry, create a valid representation of the geometry.

Bounding Box Functions

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

FunctionDescription
ST_BoundingDiagonalReturns 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...
ST_EnvelopeReturn the envelope boundary of A
ST_ExpandReturns a geometry expanded from the bounding box of the input. The expansion can be specified in two ways:
ST_XMaxReturns the maximum X coordinate of a geometry
ST_XMinReturns the minimum X coordinate of a geometry
ST_YMaxReturn the minimum Y coordinate of A
ST_YMinReturn the minimum Y coordinate of A
ST_ZMaxReturns Z maxima of the given geometry or null if there is no Z coordinate.
ST_ZMinReturns Z minima of the given geometry or null if there is no Z coordinate.

Spatial Indexing

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

FunctionDescription
ST_BingTileCreates a Bing Tile quadkey from tile XY coordinates and a zoom level.
ST_BingTileAtReturns the Bing Tile quadkey for a given point (longitude, latitude) at a specified zoom level.
ST_BingTileCellIDsReturns an array of Bing Tile quadkey strings that cover the given geometry at the specified zoom level.
ST_BingTilePolygonReturns the bounding polygon (Geometry) of the Bing Tile identified by the given quadkey.
ST_BingTilesAroundReturns 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...
ST_BingTileToGeomReturns a GeometryCollection of Polygons for the corresponding Bing Tile quadkeys.
ST_BingTileXReturns the tile X coordinate of the Bing Tile identified by the given quadkey.
ST_BingTileYReturns the tile Y coordinate of the Bing Tile identified by the given quadkey.
ST_BingTileZoomLevelReturns the zoom level of the Bing Tile identified by the given quadkey.
ST_GeoHashNeighborReturns the neighbor geohash cell in the given direction. Valid directions are: n, ne, e, se, s, sw, w, nw (case-insensitive).
ST_GeoHashNeighborsReturns 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.
ST_S2CellIDsCover the geometry with Google S2 Cells, return the corresponding cell IDs with the given level. The level indicates the size of cells. With...