SQL Function Reference¶
ST_Affine¶
Applies an affine transformation to a geometry.
Usage¶
geometry ST_Affine(geom: geometry, a: double, b: double, d: double, e: double, xOff: double, yOff: double)
geometry ST_Affine(geom: geometry, a: double, b: double, c: double, d: double, e: double, f: double, g: double, h: double, i: double, xOff: double, yOff: double, zOff: double)
ST_Analyze_Agg¶
Computes the statistics of geometries for the input geometry.
Usage¶
struct ST_Analyze_Agg(geom: geometry)
ST_Area¶
Returns the area of a geometry.
Usage¶
geometry ST_Area(geom: geometry)
ST_AsBinary¶
Converts a geometry to Well-Known Binary (WKB) format.
Usage¶
geometry ST_AsBinary(geom: geometry)
ST_AsEWKB¶
Returns the EWKB representation of a geometry or geography.
Usage¶
binary ST_AsEWKB(geom: geometry)
ST_AsGeoJSON¶
Returns the GeoJSON representation of a geometry.
Usage¶
string ST_AsGeoJSON(geom: geometry)
ST_AsText¶
Returns the Well-Known Text string representation of a geometry or geography.
Usage¶
string ST_AsText(geom: geometry)
ST_Azimuth¶
Returns the azimuth between two points in radians, or NULL if not available.
Usage¶
double ST_Azimuth(geomA: geometry, geomB: geometry)
ST_Boundary¶
Returns the closure of the combinatorial boundary of this Geometry.
Usage¶
geometry ST_Boundary(geom: geometry)
ST_Buffer¶
Computes a geometry that represents all points whose distance from the input geometry is less than or equal to a specified distance.
Usage¶
geometry ST_Buffer(geom: geometry, distance: float64)
geometry ST_Buffer(geom: geometry, distance: float64, params: string)
ST_Centroid¶
Returns the centroid of a geometry.
Usage¶
geometry ST_Centroid(geom: geometry)
ST_ClosestPoint¶
Returns the 2-dimensional point on geom1 that is closest to geom2.
Usage¶
geometry ST_ClosestPoint(geomA: geometry, geomB: geometry)
geography ST_ClosestPoint(geogA: geography, geogB: geography)
ST_Collect_Agg¶
Combines multiple geometries from a set of rows into a single collection.
Usage¶
geometry ST_Collect_Agg(geom: geometry)
ST_ConcaveHull¶
Returns a concave hull enclosing the input geometry.
Usage¶
geometry ST_ConcaveHull(geom: geometry, pct_convex: double)
ST_Contains¶
Returns true if geomA contains geomB.
Usage¶
boolean ST_Contains(geomA: geometry, geomB: geometry)
ST_ConvexHull¶
Returns the Convex Hull of polygon A.
Usage¶
geometry ST_ConvexHull(geom: geometry)
ST_CoveredBy¶
Returns true if geomA is covered by geomB.
Usage¶
boolean ST_CoveredBy(geomA: geometry, geomB: geometry)
ST_Covers¶
Returns true if geomA covers geomB.
Usage¶
boolean ST_Covers(geomA: geometry, geomB: geometry)
ST_Crosses¶
Returns true if A crosses B.
Usage¶
boolean ST_Crosses(geomA: geometry, geomB: geometry)
ST_CRS¶
Returns the Coordinate Reference System (CRS) metadata associated with a geometry or geography object.
Usage¶
string ST_CRS(geom: geometry)
ST_Difference¶
Computes the difference between geomA and geomB.
Usage¶
geometry ST_Difference(geomA: geometry, geomB: geometry)
ST_Dimension¶
Returns the dimension of the geometry.
Usage¶
integer ST_Dimension(geom: geometry)
ST_Disjoint¶
Returns true if geomA is disjoint from geomB.
Usage¶
boolean ST_Disjoint(geomA: geometry, geomB: geometry)
ST_Distance¶
Returns the distance between two geometries or geographies.
Usage¶
double ST_Distance(geomA: geometry, geomB: geometry)
ST_Dump¶
Expands multi-part geometries into child parts
Usage¶
struct ST_Dump(geom: geometry)
ST_DWithin¶
Returns true if two geometries are within a specified distance of each other.
Usage¶
boolean ST_DWithin(geomA: geometry, geomB: geometry, distance: double)
ST_EndPoint¶
Returns last point of a linestring.
Usage¶
geometry ST_EndPoint(geom: geometry)
ST_Envelope¶
Returns the bounding box (envelope) of a geometry as a new geometry.
Usage¶
geometry ST_Envelope(geom: geometry)
ST_Envelope_Agg¶
An aggregate function that returns the collective bounding box (envelope) of a set of geometries.
Usage¶
geometry ST_Envelope_Agg(geom: geometry)
ST_Equals¶
Returns true if geomA equals geomB.
Usage¶
boolean ST_Equals(geomA: geometry, geomB: geometry)
ST_FlipCoordinates¶
Returns a new geometry with the X and Y coordinates of each vertex swapped.
Usage¶
geometry ST_FlipCoordinates(geom: geometry)
geography ST_FlipCoordinates(geog: geography)
ST_Force2D¶
Forces a geometry into a XY coordinate model.
Usage¶
geometry ST_Force2D(geom: geometry)
ST_Force3D¶
Forces a geometry into a XYZ coordinate model with an optional Z value.
Usage¶
geometry ST_Force3D(geom: geometry)
geometry ST_Force3D(geom: geometry, z: double)
ST_Force3DM¶
Forces a geometry into a XYM coordinate model with an optional M value.
Usage¶
geometry ST_Force3DM(geom: geometry)
geometry ST_Force3DM(geom: geometry, m: double)
ST_Force4D¶
Forces a geometry into a XYZM coordinate model with optional Z and M values.
Usage¶
geometry ST_Force4D(geom: geometry)
geometry ST_Force4D(geom: geometry, z: double)
geometry ST_Force4D(geom: geometry, z: double, m: double)
ST_GeogFromWKB¶
Constructs a Geography from WKB Binary.
Usage¶
geography ST_GeogFromWKB(wkb: binary)
ST_GeogFromWKT¶
Constructs a Geography from WKT.
Usage¶
geography ST_GeogFromWKT(wkt: string)
geography ST_GeogFromWKT(wkt: string, srid: integer)
ST_GeogPoint¶
Creates a geography POINT from given longitude and latitude coordinates.
Usage¶
geography ST_GeogPoint(longitude: double, latitude: double)
ST_GeometryN¶
Returns the 0-based Nth geometry if the geometry is a GEOMETRYCOLLECTION, (MULTI)POINT, (MULTI)LINESTRING, MULTICURVE or (MULTI)POLYGON.
Usage¶
geometry ST_GeometryN(geom: geometry, n: integer)
ST_GeometryType¶
Returns the type of a geometry.
Usage¶
string ST_GeometryType(geom: geometry)
ST_GeomFromEWKB¶
Constructs a geometry from Extended Well-Known Binary (EWKB).
Usage¶
geometry ST_GeomFromEWKB(ewkb: binary)
ST_GeomFromEWKT¶
Constructs a geometry from Extended Well-Known Text (EWKT).
Usage¶
geometry ST_GeomFromEWKT(ewkt: string)
ST_GeomFromWKB¶
Constructs a Geometry from Well-Known Binary (WKB).
Usage¶
geometry ST_GeomFromWKB(wkb: binary)
geometry ST_GeomFromWKB(wkb: binary, srid: crs)
ST_GeomFromWKT¶
Constructs a Geometry from Well-Known Text (WKT).
Usage¶
geometry ST_GeomFromWKT(wkt: string)
geometry ST_GeomFromWKT(wkt: string, srid: crs)
ST_HasM¶
Returns true if the geometry has a M dimension.
Usage¶
boolean ST_HasM(geom: geometry)
ST_HasZ¶
Returns true if the geometry has a Z dimension.
Usage¶
boolean ST_HasZ(geom: geometry)
ST_InteriorRingN¶
Returns the Nth interior ring of a polygon.
Usage¶
geometry ST_InteriorRingN(geom: geometry, n: integer)
ST_Intersection¶
Computes the intersection of two geometries or geographies.
Usage¶
geometry ST_Intersection(geomA: geometry, geomB: geometry)
geography ST_Intersection(geogA: geography, geogB: geography)
ST_Intersection_Agg¶
Returns the cumulative intersection of all geometries in the input.
Usage¶
geometry ST_Intersection_Agg(geom: geometry)
ST_Intersects¶
Returns true if geomA intersects geomB.
Usage¶
boolean ST_Intersects(geomA: geometry, geomB: geometry)
ST_IsClosed¶
Returns true if the LINESTRING start and end point are the same.
Usage¶
boolean ST_IsClosed(geom: geometry)
ST_IsCollection¶
Returns TRUE if the geometry type of the input is a geometry collection type.
Usage¶
boolean ST_IsCollection(geom: geometry)
ST_IsEmpty¶
Returns true if the geometry is empty.
Usage¶
boolean ST_IsEmpty(geom: geometry)
ST_IsRing¶
Returns true if a linestring is ST_IsClosed and ST_IsSimple.
Usage¶
boolean ST_IsRing(geom: geometry)
ST_IsSimple¶
Tests if geometry’s only self-intersections are at boundary points.
Usage¶
boolean ST_IsSimple(geom: geometry)
ST_IsValid¶
Checks whether a geometry meets the rules of a valid spatial object according to the OGC standard.
Usage¶
boolean ST_IsValid(geom: geometry)
ST_IsValidReason¶
Returns a text explanation describing why a geometry is invalid.
Usage¶
string ST_IsValidReason(geom: geometry)
ST_KNN¶
Returns true if geomA finds k nearest neighbors from geomB.
Usage¶
boolean ST_KNN(geomA: geometry, geomB: geometry, k: integer, use_spheroid: boolean)
boolean ST_KNN(geomA: geometry, geomB: geometry, k: integer)
boolean ST_KNN(geomA: geometry, geomB: geometry)
ST_Length¶
Returns the length of a geometry.
Usage¶
double ST_Length(geom: geometry)
ST_LineInterpolatePoint¶
Returns a point interpolated along a line.
Usage¶
geometry ST_LineInterpolatePoint(geom: geometry, fraction: double)
ST_LineLocatePoint¶
Returns the location of the closest point on a LineString as a fraction of its total length.
Usage¶
double ST_LineLocatePoint(geomA: geometry, geomB: geometry)
ST_LineMerge¶
Merges a collection of potentially connected line segments into the fewest possible LineStrings.
Usage¶
geometry ST_LineMerge(geom: geometry)
ST_M¶
Returns the M (measure) coordinate of a Point geometry.
Usage¶
double ST_M(geom: geometry)
ST_MakeLine¶
Creates a LineString from two or more input geometries.
Usage¶
geometry ST_MakeLine(geomA: geometry, geomB: geometry)
ST_MakeValid¶
Creates a valid representation of an invalid geometry.
Usage¶
geometry ST_MakeValid(geom: geometry)
geometry ST_MakeValid(geom: geometry, keepCollapsed: boolean)
ST_MaxDistance¶
Returns the maximum distance between any pair of points in two geometries.
Usage¶
double ST_MaxDistance(geomA: geometry, geomB: geometry)
ST_MinimumClearance¶
Returns the minimum clearance of a geometry.
Usage¶
double ST_MinimumClearance(geom: geometry)
ST_MinimumClearanceLine¶
Returns a LineString representing the minimum clearance distance of the input geometry.
Usage¶
geometry ST_MinimumClearanceLine(geom: geometry)
ST_MMax¶
Returns the maximum M (measure) value from a geometry’s bounding box.
Usage¶
double ST_MMax(geom: geometry)
ST_MMin¶
Returns the minimum M-coordinate (measure) of a geometry’s bounding box.
Usage¶
double ST_MMin(geom: geometry)
ST_NPoints¶
Returns the number of points of the geometry.
Usage¶
integer ST_NPoints(geom: geometry)
ST_NumGeometries¶
Returns the number of geometries in a geometry collection.
Usage¶
integer ST_NumGeometries(geom: geometry)
ST_Overlaps¶
Returns true if A overlaps B.
Usage¶
boolean ST_Overlaps(geomA: geometry, geomB: geometry)
ST_Perimeter¶
Calculates the 2D perimeter of a given geometry.
Usage¶
double ST_Perimeter(geom: geometry)
ST_Point¶
Constructs a Point Geometry from X and Y.
Usage¶
geometry ST_Point(x: double, y: double, srid: crs)
ST_PointM¶
Constructs a Point with an M (measure) coordinate from X, Y, and M values.
Usage¶
geometry ST_PointM(x: double, y: double, m: double)
ST_PointN¶
Returns the Nth point in a linestring.
Usage¶
geometry ST_PointN(geom: geometry, n: integer)
ST_Points¶
Returns a MultiPoint geometry consisting of all the coordinates of the input geometry.
Usage¶
geometry ST_Points(geom: geometry)
ST_PointZ¶
Constructs a Point with a Z coordinate from X, Y, and Z values.
Usage¶
geometry ST_PointZ(x: double, y: double, z: double)
ST_PointZM¶
Constructs a Point with X, Y, Z and M coordinates.
Usage¶
geometry ST_PointZM(x: double, y: double, z: double, m: double)
ST_Polygonize¶
Builds a polygonal geometry from linear components in the input geometry.
Usage¶
geometry ST_Polygonize(geom: geometry)
ST_Polygonize_Agg¶
Creates polygons from a set of geometries that contain linework representing the edges of a polygon.
Usage¶
geometry ST_Polygonize_Agg(geom: geometry)
ST_Reverse¶
Returns the geometry with vertex order reversed.
Usage¶
geometry ST_Reverse(geom: geometry)
ST_Rotate¶
Rotates a geometry counter-clockwise around the Z axis by an angle in radians.
Usage¶
geometry ST_Rotate(geom: geometry, rot: double)
ST_RotateX¶
Rotates a geometry around the X axis by an angle in radians.
Usage¶
geometry ST_RotateX(geom: geometry, rot: double)
ST_RotateY¶
Rotates a geometry around the Y axis by an angle in radians.
Usage¶
geometry ST_RotateY(geom: geometry, rot: double)
ST_Scale¶
Scales a geometry by multiplying ordinates with scale factors.
Usage¶
geometry ST_Scale(geom: geometry, scaleX: double, scaleY: double)
geometry ST_Scale(geom: geometry, scaleX: double, scaleY: double, scaleZ: double)
ST_SetCRS¶
Sets the Coordinate Reference System (CRS) for a geometry.
Usage¶
geometry ST_SetCRS(geom: geometry, target_crs: string)
geography ST_SetCRS(geog: geography, target_crs: string)
ST_SetSRID¶
Sets the SRID (spatial reference identifier) for a geometry.
Usage¶
geometry ST_SetSRID(geom: geometry, srid: integer)
ST_Simplify¶
Simplifies an input geometry using the Douglas-Peucker algorithm.
Usage¶
geometry ST_Simplify(geom: geometry, tolerance: double)
ST_SimplifyPreserveTopology¶
Simplifies a geometry, ensuring the result is a valid geometry with the same topology.
Usage¶
geometry ST_SimplifyPreserveTopology(geom: geometry, tolerance: double)
ST_Snap¶
Snaps input geometry to reference geometry within tolerance.
Usage¶
geometry ST_Snap(geomA: geometry, geomB: geometry, tolerance: double)
ST_SRID¶
Returns the SRID (spatial reference identifier) of a geometry.
Usage¶
integer ST_SRID(geom: geometry)
ST_StartPoint¶
Returns the start point of a linestring geometry.
Usage¶
geometry ST_StartPoint(geom: geometry)
ST_SymDifference¶
Returns the parts of geometries A and B that do not overlap.
Usage¶
geometry ST_SymDifference(geomA: geometry, geomB: geometry)
ST_Touches¶
Returns true if A touches B.
Usage¶
boolean ST_Touches(geomA: geometry, geomB: geometry)
ST_Transform¶
Transforms a geometry from one coordinate reference system to another.
Usage¶
geometry ST_Transform(geom: geometry, target_crs: string)
geometry ST_Transform(geom: geometry, source_crs: string, target_crs: string)
ST_Translate¶
Returns a geometry with coordinates translated by deltaX and deltaY.
Usage¶
geometry ST_Translate(geom: geometry, deltaX: double, deltaY: double)
geometry ST_Translate(geom: geometry, deltaX: double, deltaY: double, deltaZ: double)
ST_UnaryUnion¶
Returns a single geometry which is the union of all components.
Usage¶
geometry ST_UnaryUnion(geom: geometry)
ST_Union¶
Returns a geometry that represents the point set union of two geometries.
Usage¶
geometry ST_Union(geomA: geometry, geomB: geometry)
ST_Union_Agg¶
Returns a geometry that represents the point set union of all geometries.
Usage¶
geometry ST_Union_Agg(geom: geometry)
ST_Within¶
Returns true if A is completely inside B.
Usage¶
boolean ST_Within(geomA: geometry, geomB: geometry)
ST_X¶
Returns the X coordinate of the point, or NULL if not available.
Usage¶
double ST_X(geom: geometry)
ST_XMax¶
Returns the maximum X coordinate of a geometry’s bounding box.
Usage¶
double ST_XMax(geom: geometry)
ST_XMin¶
Returns the minimum X coordinate of a geometry’s bounding box.
Usage¶
double ST_XMin(geom: geometry)
ST_Y¶
Returns the Y coordinate of the point, or NULL if not available.
Usage¶
double ST_Y(geom: geometry)
ST_YMax¶
Returns the maximum Y coordinate of a geometry’s bounding box.
Usage¶
double ST_YMax(geom: geometry)
ST_YMin¶
Returns the minimum Y coordinate of a geometry’s bounding box.
Usage¶
double ST_YMin(geom: geometry)
ST_Z¶
Returns the Z coordinate of the point, or NULL if not available.
Usage¶
double ST_Z(geom: geometry)
ST_ZMax¶
Returns the maximum Z coordinate of a geometry’s bounding box.
Usage¶
double ST_ZMax(geom: geometry)
ST_Zmflag¶
Returns a code indicating the dimension of the coordinates in a geometry.
Usage¶
integer ST_Zmflag(geom: geometry)
ST_ZMin¶
Returns the minimum Z coordinate of a geometry’s bounding box.
Usage¶
double ST_ZMin(geom: geometry)