Summary of spatial functions by task type

The spatial data type functions do different types of tasks, such as generating different formats, manipulating or comparing data, and obtaining information about data.

The following table shows the spatial data type functions arranged by task type.
Table 1. Spatial functions by task type

This table has spanned cells in the first column that represent task types. The second and third columns have multiple rows of descriptions and functions names for each task type.

Function task type Description Function name
Generate a geometry from a well-known text representation. Takes a well-known text representation and returns an ST_Geometry using SRID 0 The ST_WKTToSQL() function
Takes a well-known text representation and returns an ST_Geometry The ST_GeomFromText() function
Takes a well-known text representation and returns an ST_Point The ST_PointFromText() function
Takes a well-known text representation and returns an ST_LineString The ST_LineFromText() function
Takes a well-known text representation and returns an ST_Polygon The ST_PolyFromText() function
Takes a well-known text representation and returns an ST_MultiLine The ST_MLineFromText() function
Takes a well-known text representation and returns an ST_MultiPoint The ST_MPointFromText() function
Takes a well-known text representation and returns an ST_MultiPolygon The ST_MPolyFromText() function
Generate a geometry from a well-known binary representation. Takes a well-known binary representation and returns an ST_Geometry using SRID 0 The ST_WKBToSQL() function
Takes a well-known binary representation and returns an ST_Geometry The ST_GeomFromWKB() function
Takes a well-known binary representation and returns an ST_Point The ST_PointFromWKB() function
Takes a well-known binary representation and returns an ST_LineString The ST_LineFromWKB() function
Takes a well-known binary representation and returns an ST_Polygon The ST_PolyFromWKB() function
Takes a well-known binary representation and returns an ST_MultiLine The ST_MLineFromWKB() function
Takes a well-known binary representation and returns an ST_MultiPoint The ST_MPointFromWKB() function
Takes a well-known binary representation and returns an ST_MultiPolygon The ST_MPolyFromWKB() function
Generate a geometry from an ESRI shape representation. Takes an ESRI shape representation and returns an ST_Geometry using SRID 0 The SE_ShapeToSQL() function
Takes an ESRI shape representation and returns an ST_Geometry The SE_GeomFromShape() function
Takes an ESRI shape representation and returns an ST_Point The SE_PointFromShape() function
Takes an ESRI shape representation and returns an ST_LineString The SE_LineFromShape() function
Takes an ESRI shape representation and returns an ST_Polygon The SE_PolyFromShape() function
Takes an ESRI shape representation and returns an ST_MultiLine The SE_MLineFromShape() function
Takes an ESRI shape representation and returns an ST_MultiPoint The SE_MPointFromShape() function
Takes an ESRI shape representation and returns an ST_MultiPolygon The SE_MPolyFromShape() function
Generate a geometry from a GML representation. Takes a GML2 or GML3 string representation of an envelope and returns an ST_Polygon The ST_EnvelopeFromGML() function
Takes a GML2 or GML3 string representation and returns an ST_Geometry The ST_GeomFromGML() function
Takes a GML2 or GML3 string representation and returns an ST_LineString The ST_LineFromGML() function
Takes a GML2 or GML3 string representation and returns an ST_MultiLineString The ST_MLineFromGML() function
Takes a GML2 or GML3 string representation and returns an ST_MultiPoint The ST_MPointFromGML() function
Takes a GML2 or GML3 string representation and returns an ST_MultiPolygon The ST_MPolyFromGML() function
Takes a GML2 or GML3 string representation and returns an ST_Point The ST_PointFromGML() function
Takes a GML2 or GML3 string representation and returns an ST_Polygon The ST_PolyFromGML() function
Generate a geometry from a KML representation. Takes a KML LatLonBox string representation and returns an ST_Polygon The SE_EnvelopeFromKML() function
Takes a KML fragment string representation and returns an ST_Geometry The ST_GeomFromKML() function
Takes a KML LineString string representation and returns an ST_LineString The ST_LineFromKML() function
Takes a KML MultiGeometry string representation and returns an ST_MultiLineString The ST_MLineFromKML() function
Takes a KML MultiGeometry and Point combination string representation and returns an ST_MultiPoint The ST_MPointFromKML() function
Takes a KML MultiGeometry and Polygon combination string representation and returns an ST_MultiPolygon The ST_MPolyFromKML() function
Takes a KML Point string representation and returns an ST_Point The ST_PointFromKML() function
Takes a KML Polygon string representation and returns an ST_Polygon The ST_PolyFromKML() function
Convert a geometry to an external format. Returns the well-known text representation of a geometry object The ST_AsText() function
Returns the well-known binary representation of a geometry object The ST_AsBinary() function
Returns a BSON representation in GeoJSON format of a geometry object The SE_AsBSON() function
Returns the ESRI shape representation of a geometry object The SE_AsShape() function
Returns the GML representation of a geometry object The SE_AsGML() function or The ST_AsGML() function
Returns the GML3 Envelope element of an ST_Envelope object The ST_EnvelopeAsGML() function
Returns the KML representation of a geometry object The ST_AsKML() function or The SE_AsKML() function
Returns the KML LatLonBox of an ST_Envelope object The SE_EnvelopeAsKML() function
Manipulate the ST_Point data type. Creates an ST_Point data type from an X and Y coordinate The ST_Point() function
Returns the X coordinate of a point The ST_X() function
Returns the Y coordinate of a point The ST_Y() function
Returns the Z coordinate of a point The ST_Z function
Returns the measure value of a point The ST_M() function
Manipulate the ST_LineString and ST_MultiLineString data types. Returns the first point The ST_StartPoint() function
Returns the midpoint The SE_Midpoint() function
Returns the last point The ST_EndPoint() function
Returns the nth point The ST_PointN() function
Returns the length The ST_Length() function
Creates an ST_Polygon from a ring (closed linestring) The ST_Polygon() function
Manipulate the ST_Polygon and ST_MultiPolygon data types. Calculates the area The ST_Area() function
Calculates the geometric center The ST_Centroid() function
Returns the exterior ring The ST_ExteriorRing() function
Counts the number of interior rings The ST_NumInteriorRing() function
Returns the nth interior ring The ST_InteriorRingN() function
Returns a point on the surface The ST_PointOnSurface() function
Returns the perimeter The ST_Perimeter() function
Obtain parameters of a geometry. Returns the dimensions of the coordinates The ST_CoordDim() function
Returns the dimension of the geometry The ST_Dimension() function
Returns the shortest distance to another geometry The ST_Distance() function
Returns the distance to a point The ST_DistanceToPoint() function
Returns the point at a specific distance The ST_PointAtDistance() function
Returns the data type The ST_GeometryType() function
Returns the number of points The ST_NumPoints() function
Returns the spatial reference ID The ST_SRID() function
Returns the maximum and minimum X coordinate The ST_MaxX() and ST_MinX() functions
Returns the maximum and minimum Y coordinate The ST_MaxY() and ST_MinY() functions
Returns the maximum and minimum Z coordinate The ST_MaxZ() and ST_MinZ() functions
Returns the maximum and minimum measure value The ST_MaxM() and ST_MinM() functions
Determine the properties of a geometry. Determines whether a linestring or multilinestring is closed The ST_IsClosed() function
Determines whether a geometry is empty (it has no points) The ST_IsEmpty() function
Determines whether a geometry has measures The ST_IsMeasured() function
Determines whether a linestring is a ring (it is closed and simple) The ST_IsRing() function
Determines whether a geometry is simple The ST_IsSimple() function
Determines whether a geometry is topologically valid The ST_IsValid() function
Determines whether an object has Z coordinates The ST_Is3D() function
Tests whether two geometries meet the conditions specified by a specified DE-91M pattern matrix The ST_Relate() function
Determine whether a certain relationship exists between two geometries. Determines whether one geometry completely contains another The ST_Contains() function
Determines whether a geometry crosses another The ST_Crosses() function
Determines whether two geometries are non-intersecting The ST_Disjoint() function
Determines whether the envelopes of two geometries intersect The SE_EnvelopesIntersect() function
Determines whether two geometries are spatially equal The ST_Equals() function
Determines whether two geometries intersect The ST_Intersects() function
Determines whether two geometries overlap The ST_Overlaps() function
Determines whether two geometries touch The ST_Touches() function
Determines whether one object is completely inside another The ST_Within() function
Compare geometries and return a new geometry based on how the geometries are related. An aggregate function that computes the union of geometries of the same dimension The SE_Dissolve() function
Returns the portion of the primary geometry that is not intersected by the secondary geometry The ST_Difference() function
Computes the intersection of two geometries The ST_Intersection() function
Returns the perpendicular projection of a point on the nearest segment of a linestring The SE_PerpendicularPoint() function
Returns an ST_Geometry object that is composed of the parts of the two source geometries that are not common to both The ST_SymDifference() function
Computes the union of two geometries The ST_Union() function
Generate a new geometry from an existing geometry. Generates a geometry that is the buffer that surrounds the source object The ST_Buffer() function
Generates the combined boundary of the geometry The ST_Boundary() function
Calculates the spatial extent of all geometries in a table column The SE_BoundingBox() function
Generates the convex hull of a geometry The ST_ConvexHull() function
Generates the bounding box of a geometry The ST_Envelope() function
Generates a geometry with fewer vertices but of the same general shape The SE_Generalize() function
Generates an ST_MultiPoint representing points that have the specified measure value The ST_LocateAlong() function
Generates an ST_MultiPoint or ST_MultiLineString representing points or paths that have measures in the specified range The ST_LocateBetween() function
Appends a vertex to a linestring The SE_VertexAppend() function
Deletes a vertex from a geometry The SE_VertexDelete() function
Updates a vertex in a geometry The SE_VertexUpdate() function
Manage collections. Returns the nth geometry The ST_GeometryN() function
Returns the number of geometries in the collection The ST_NumGeometries() function
Nearest-neighbor queries. Retrieves nearby geometries in increasing distance order. SE_NearestBbox() is similar to SE_Nearest(), but measures distances between bounding boxes of geometries. The SE_Nearest() and SE_NearestBbox() functions
Assist in managing spatial reference systems. Computes the false origin and system units for a data set and creates an entry in the spatial_references table The SE_CreateSRID() function
Returns the OGC well-known text representation of a spatial reference system The SE_CreateSrtext() function
Returns the text for all types of spatial reference systems that use the specified ID The SE_CreateSrtextList() function
Returns the number of spatial reference system types for a specified ID The SE_CreateSrtextCount() function
Returns the spatial reference ID for a geometry The ST_SRID() function
Returns the Authority Name and Authority SRID of a spatial reference ID The SE_SRID_Authority() function
Transforms a geometry from one spatial reference system to another The ST_Transform() function
Administration Returns the in-row, out-of-row, and total size of a geometry in bytes

The SE_InRowSize() function

The SE_OutOfRowSize() function

The SE_TotalSize() function

Reinitializes the spatial reference system memory cache The SE_MetadataInit() function
Returns the value of a specified parameter or all parameters if called with no parameters The SE_ParamGet() function
Sets the specified parameter to a new value The SE_ParamSet() function
Returns usage information (if called with no parameters) The SE_ParamSet() function
Returns the version and release date of the spatial data extension The SE_Release() function
Generates a sort key for geometries The SE_SpatialKey() function
Controls tracing to assist in debugging The SE_Trace() function