PostGIS pl/pgSQL Spatial Functions
$5.00 (inc. GST Australia)
A collection of PostGIS pl/pgSQL functions to enhance one’s use of PostGIS.
Some of the functions are geography wrappers over existing PostGIS geometry functions (marked with *).
DD2DMS -- Returns string equivalent of decimal degree numeric value. DMS2DD -- Function computes a decimal degree floating point number from individual degrees, minutes and seconds values. DMSS2DD -- Function computes a decimal degree floating point number from individual degrees, minutes and seconds values encoded in supplied string. ST_Average -- Averages ordinates of 2 Points ST_BearingBetweenPoints(geometry,geometry) -- Returns a (Normalized) bearing in Degrees between two non-geodetic (XY) coordinates ST_BearingBetweenPoints(numeric,numeric,numeric,numeric) -- Returns a (Normalized) bearing in Degrees between two non-geodetic (XY) coordinates ST_Chop -- Splits a (multi)linestring into individual linestrings. ST_Densify -- Adds additional vertices to geometries defined by linestrings. ST_Explode -- Extracts elements that described the supplied object; rings of polygons; circularstring/linestring from CompoundCurve ST_Extend -- Function which extends the supplied linestring required distance at its start/end or both. ST_Hilbert -- Function that generates a Hilbert number from the supplied grid inputs. ST_Hilbert2Point -- Function that generates a point at the Hilbert number created from the supplied grid inputs. ST_InsideLine(p_point geometry,p_direction_start numeric,p_direction_end numeric,p_polygon geometry,p_dIncrement numeric) -- Generates a line that is fitted inside a polygon. ST_IsCollinear (geometry,geometry,geometry) -- Checks three points are collinear ST_IsGeographicSrid -- Checks p_srid to see if exists in sys.spatial_reference_systems table (which holds geodetic SRIDS) ST_LineInsidePolygon (p_point geometry,p_bearing numeric,p_length numeric,p_polygon geometry) -- Generates line and clips to polygon returning part p_point is within ST_Line_Offset -- Creates offset lines that smooth the boundaries between the input geometry. ST_Morton -- Calculates the Morton number of a cell defined by input parameters. ST_NormalizeBearing -- Function ensures supplied bearing is between 0 and 360. ST_OneSidedBuffer -- An attempt to create a buffer on one side of a line. ST_PointFromBearingAndDistance -- Returns a projected point given starting point as X and Y, a bearing in Degrees, and a distance (geometry SRID units). ST_PointFromCOGO -- Returns a projected point given starting point (geometry), a bearing in Degrees, and a distance (geometry SRID units). ST_RegularGrid -- Function that creates a set of rectangular grid cells over the supplied geometry ST_RegularGridSQL -- Wrapper over ST_RegularGrid ST_RegularGridXY -- Function that creates a set of rectangular grid cells over the supplied geometry ST_RegularGridXYSQL -- Wrapper over ST_RegularGridXY ST_SmoothTile -- Function that removes "steps" in vector data created by raster processing. ST_Splay -- Function that creates label locations around a geometry for display in GIS like qGIS. ST_Stitch_LineString -- Stitches linestrings together using ST_OffsetCurve. ST_ToGeography -- Converts a geometry object to a geography. ST_ToGeometry -- Converts a geography object to a geometry. ST_VectorAsSegment -- Takes vectors (2/3 point linestring/circularstring segments) from ST_Vectorize and creates a geometry representation of the segment ST_Vectorize -- Splits a linestring/multilinestring,polygon or multipolygon(rings) into 2 vertex linestrings or 3 vertex circularstrings. random_between(numeric,numeric) -- Randomly generates number in range defined by parameters. Geography Wrappers. ST_AddMeasure * ST_AddPoint * ST_CoordDim * ST_Dimension * ST_EndPoint * ST_ExteriorRing * ST_FlipCoordinates * ST_GeometryN * ST_GeometryType * ST_InteriorRingN * ST_IsClosed * ST_IsEmpty * ST_IsValid * ST_IsValidDetail * ST_IsValidReason * ST_M * ST_NPoints * ST_NumGeometries * ST_NumInteriorRings * ST_NumPoints * ST_PointN * ST_Points * ST_RemovePoint * ST_SetPoint * ST_StartPoint * ST_X * ST_Y * ST_Z *