GeoWebApp Building
Spatial functions in PostGIS
Some commonly used spatial functions in PostGIS:
Geometry Constructors:
ST_MakePoint: Creates a point geometry from X and Y coordinates.
ST_GeomFromText: Creates a geometry from a well-known text
representation.
ST_GeomFromEWKT: Creates a geometry from an extended well-known
text representation.
ST_GeomFromGeoJSON: Creates a geometry from a GeoJSON
representation.
Geometry Accessors:
ST_GeometryType: Returns the geometry type.
ST_SRID: Returns the spatial reference identifier of a geometry.
ST_X: Returns the X coordinate of a point.
ST_Y: Returns the Y coordinate of a point.
ST_Transform: Transforms a geometry from one spatial reference system
(SRS) to another.
Spatial Relationship Functions:
ST_Equals: Tests if two geometries are spatially equal.
ST_Disjoint: Tests if two geometries are spatially disjoint.
ST_Touches: Tests if two geometries share points but do not overlap.
ST_Within: Tests if one geometry is within another.
ST_DWithin: Tests if one geometry is within a specific distance (radius) of
one another.
ST_Contains: Tests if one geometry contains another.
ST_Intersects: Tests if two geometries intersect.
ST_Crosses: Tests if two geometries cross each other.
ST_Overlaps: Tests if two geometries overlap.
Geometry Measurements:
ST_Area: Computes the area of a geometry.
ST_Length: Computes the length of a linestring.
ST_Distance: Computes the distance between two geometries.
Geometry Processing Functions:
ST_Buffer: Computes a buffer around a geometry.
ST_Intersection: Computes the intersection of two geometries.
ST_Union: Computes the union of multiple geometries.
ST_Difference: Computes the difference between two geometries.
ST_Centroid: Computes the centroid (center of mass) of a set of geometries.
ST_ConvexHull: Computes the smallest convex geometry that encloses a
set of geometries.
ST_MinimumBoundingCircle: Computes the minimum bounding circle of a
set of geometries.
ST_Accum: Accumulates values into an array.