GIS Functions
Reference

PostGIS, Turf.js, and GDAL functions — syntax, examples, and when to use each.

All
PostGIS
Turf.js
GDAL
All
Affine Transformations
Aggregation
Assertions
Booleans
Bounding Box
Clustering
Coordinate Mutation
Coverages
DE-9IM
Data
Distance Relationships
Feature Conversion
Geometry Accessors
Geometry Constructors
Geometry Editors
Geometry Input
Geometry Processing
Geometry Validation
Grids
Helper
Interpolation
Joins
Linear Referencing
Measurement
Meta
Metadata
Misc
Multidimensional
Overlay
Random
Raster Conversion
Raster Info
Raster Processing
Spatial Reference System
Spatial Relationships
Trajectory
Transformation
Vector Conversion
Vector Info
Vector Processing
429 functions
PostGIS

Box2D

Returns a 2D bounding box of type box2d that tightly encloses the given geometry.

Bounding Box
PostGIS

Box3D

Returns a 3D bounding box of type box3d enclosing a geometry, including its Z values when present.

Bounding Box
GDAL

gdal_calc

Evaluates NumPy expressions across raster bands, the command-line raster calculator for band math and thresholding.

Raster Processing
GDAL

gdal_contour

Generates vector contour lines or polygons from a raster elevation or continuous-value dataset.

Raster Processing
GDAL

gdal_edit

Edits raster georeferencing, CRS, NoData, and metadata in place without rewriting pixel data.

Metadata
GDAL

gdal_fillnodata

Fills NoData pixels in a raster by interpolating from surrounding valid pixels, closing gaps in DEMs and imagery.

Raster Processing
GDAL

gdal_grid

Interpolates scattered point data into a regular raster grid using IDW, moving average, nearest neighbour, and other methods.

Raster Processing
GDAL

gdal_merge

Mosaics multiple rasters into a single output file or stacks them as separate bands, a simpler alternative to gdalwarp for matching grids.

Raster Processing
GDAL

gdal_polygonize

Converts connected regions of same-valued raster pixels into vector polygons, the raster-to-vector counterpart of gdal_rasterize.

Raster Conversion
GDAL

gdal_proximity

Computes a raster of pixel-wise distances from each cell to the nearest target pixel in a source raster.

Raster Processing
GDAL

gdal_rasterize

Burns vector geometries into a raster, either creating a new raster or updating bands in an existing one.

Raster Conversion
GDAL

gdal_retile

Retiles a set of rasters into fixed-size tiles, optionally building a pyramid of downsampled tile sets for serving.

Raster Processing
GDAL

gdal_sieve

Removes small connected pixel regions from a classified raster by merging them into the largest adjacent neighbour.

Raster Processing
GDAL

gdal_translate

Converts raster datasets between formats and performs subsetting, band selection, type casting, and value rescaling.

Raster Conversion
GDAL

gdal_viewshed

Computes a binary or intensity viewshed raster from a DEM, identifying which cells are visible from a given observer point.

Raster Processing
GDAL

gdaladdo

Builds overview pyramids on raster datasets so viewers and warp operations can read downsampled levels quickly.

Raster Processing
GDAL

gdalbuildvrt

Builds a virtual raster (VRT) that stitches multiple input rasters into a single logical dataset without duplicating pixels.

Raster Processing
GDAL

gdalchecksum

Computes a per-band checksum of a raster dataset, providing a compact fingerprint for integrity and regression checks.

Raster Info
GDAL

gdalcompare

Reports structural, metadata, and pixel-level differences between two raster datasets for QA and regression testing.

Raster Info
GDAL

gdaldem

Generates hillshade, slope, aspect, colour-relief, TRI, TPI, and roughness rasters from a digital elevation model.

Raster Processing
GDAL

gdalinfo

Reports size, projection, band statistics, metadata, and geotransform details for any raster dataset GDAL can read.

Raster Info
GDAL

gdallocationinfo

Reports pixel values and location metadata at a given geographic or pixel coordinate in a raster dataset.

Raster Info
GDAL

gdalmanage

Identifies, copies, renames, and deletes raster datasets safely using GDAL drivers that understand multi-file formats.

Raster Info
GDAL

gdalmdiminfo

Reports the structure of a multidimensional raster dataset (groups, arrays, dimensions, attributes) for NetCDF, HDF5, and Zarr.

Multidimensional
GDAL

gdalmdimtranslate

Converts and subsets multidimensional rasters (NetCDF, HDF5, Zarr), extracting arrays or dimension slices into new datasets.

Multidimensional
GDAL

gdalmove

Transforms the georeferencing of a raster to a new CRS without resampling pixels, suitable for approximate reprojection of small-area imagery.

Raster Processing
GDAL

gdalsrsinfo

Reports a coordinate reference system in multiple formats (WKT, PROJ, EPSG) given a raster, vector, or CRS definition.

Metadata
GDAL

gdaltindex

Builds a vector tile index from a set of raster files, recording each tile's footprint and path for use as a raster catalog.

Raster Processing
GDAL

gdaltransform

Transforms coordinates between CRSes, using GCPs, or via a geotransform, reading pairs from stdin for scripted conversion.

Raster Processing
GDAL

gdalwarp

Reprojects, warps, mosaics, clips, and resamples raster datasets from the command line.

Raster Processing
PostGIS

GeometryType

Returns the geometry type of a PostGIS geometry as an uppercase string, without Z/M suffixes.

Geometry Accessors
GDAL

nearblack

Converts near-black or near-white collar pixels around imagery into exact black/white or NoData values for clean mosaicking.

Raster Processing
GDAL

ogr2ogr

Converts vector datasets between formats, reprojects, filters, and transforms features using OGR drivers and SQL.

Vector Conversion
GDAL

ogrinfo

Reports layers, schemas, feature counts, CRS, and attribute data from any OGR-readable vector dataset.

Vector Info
GDAL

ogrlineref

Performs linear referencing operations on line features, creating measure-parts layers and locating points or segments along a route.

Vector Processing
GDAL

ogrmerge

Merges multiple vector datasets into a single output, either as separate layers or as one unified layer with source tracking.

Vector Processing
GDAL

ogrtindex

Builds a vector tile index from a set of OGR-readable vector files, storing each input's footprint and path as a catalog.

Vector Processing
PostGIS

postgis_srs

Returns a metadata row describing a given authority code, using PROJ's SRS database. Available from PostGIS 3.4.

Spatial Reference System
PostGIS

postgis_srs_all

Returns a set of all SRS metadata rows known to PROJ. Available from PostGIS 3.4.

Spatial Reference System
PostGIS

postgis_srs_codes

Returns the list of SRS codes PROJ knows about for a given authority. Available from PostGIS 3.4.

Spatial Reference System
PostGIS

postgis_srs_search

Returns candidate SRSs whose area of use intersects a given bounds geometry. Available from PostGIS 3.4.

Spatial Reference System
PostGIS

ST_3DClosestPoint

Returns the 3D point on the first geometry that is closest to the second geometry, using Z coordinates.

Measurement
PostGIS

ST_3DDFullyWithin

Returns true if every point of two geometries is within a given 3D distance of the other.

Distance Relationships
PostGIS

ST_3DDistance

Returns the minimum 3D Cartesian distance between two geometries, using Z coordinates.

Measurement
PostGIS

ST_3DDWithin

Returns true if two geometries are within a given 3D distance of each other, using Z coordinates and an N-D GiST index.

Distance Relationships
PostGIS

ST_3DExtent

Aggregate function that returns the 3D bounding box covering every geometry in the input set, including Z.

Bounding Box
PostGIS

ST_3DIntersects

Returns true if two geometries share any portion of space in three dimensions, considering Z coordinates.

Spatial Relationships
PostGIS

ST_3DLength

Returns the 3D length of a linear geometry, including Z coordinate contributions.

Measurement
PostGIS

ST_3DLineInterpolatePoint

Returns a 3D point interpolated along a 3D linestring at a fractional distance using 3D length.

Linear Referencing
PostGIS

ST_3DLongestLine

Returns the 3D longest line between two geometries as a two-point LINESTRING using Z coordinates.

Measurement
PostGIS

ST_3DMakeBox

Constructs a 3D box3d from two corner points, preserving Z values.

Bounding Box
PostGIS

ST_3DMaxDistance

Returns the 3D maximum distance between two geometries using Z coordinates.

Measurement
PostGIS

ST_3DPerimeter

Returns the 3D perimeter of a polygonal geometry, including Z coordinate contributions.

Measurement
PostGIS

ST_3DShortestLine

Returns the 3D shortest LINESTRING between two geometries using Z coordinates.

Measurement
PostGIS

ST_AddMeasure

Adds interpolated M (measure) values to a linestring between a starting and ending measure.

Linear Referencing
PostGIS

ST_AddPoint

Adds a point to a LineString at a specified position, or appends it when no position is given.

Geometry Editors
PostGIS

ST_Affine

Applies a 3D affine transformation to a geometry using the supplied matrix coefficients.

Affine Transformations
PostGIS

ST_Angle

Returns the angle in radians between three points or between two vectors defined by two line segments.

Measurement
PostGIS

ST_Area

Returns the area of a polygonal geometry, using CRS units for geometry input and square metres for geography input.

Measurement
PostGIS

ST_Azimuth

Returns the north-based azimuth in radians between two points, for geometry or geography input.

Measurement
PostGIS

ST_BdMPolyFromText

Constructs a MultiPolygon from an arbitrary collection of closed LineStrings given as MultiLineString WKT.

Geometry Input
PostGIS

ST_BdPolyFromText

Constructs a Polygon from an arbitrary collection of closed LineStrings given as MultiLineString WKT.

Geometry Input
PostGIS

ST_Boundary

Returns the topological boundary of a geometry as defined by OGC, one dimension lower than the input.

Geometry Accessors
PostGIS

ST_BoundingDiagonal

Returns the diagonal of a geometry's bounding box as a two-point LineString from min corner to max corner.

Geometry Accessors
PostGIS

ST_Box2dFromGeoHash

Returns a Box2D corresponding to the area represented by a GeoHash string.

Geometry Input
PostGIS

ST_Buffer

Returns a geometry covering all points within a given distance from the input geometry.

Geometry Processing
PostGIS

ST_BuildArea

Creates an areal geometry from the constituent linework of the input geometry, forming polygons that respect holes and nested rings.

Geometry Processing
PostGIS

ST_Centroid

Returns the geometric centre (centroid) of a geometry — the mean position of all points weighted by dimension.

Geometry Processing
PostGIS

ST_ChaikinSmoothing

Smooths a geometry using Chaikin's corner-cutting algorithm, producing visually softer lines and polygons.

Geometry Processing
PostGIS

ST_ClipByBox2D

Returns the portion of a geometry falling inside a 2D bounding box, using a fast clipping algorithm.

Overlay
PostGIS

ST_ClosestPoint

Returns the 2D point on the first geometry that is closest to the second geometry.

Measurement
PostGIS

ST_ClosestPointOfApproach

Returns the M value (time) at which two trajectories are closest to each other in 3D.

Trajectory
PostGIS

ST_ClusterDBSCAN

Window function that assigns a DBSCAN cluster id to each geometry based on a distance threshold and minimum points.

Clustering
PostGIS

ST_ClusterIntersecting

Aggregate function that clusters input geometries into groups that share at least one intersecting geometry.

Clustering
PostGIS

ST_ClusterIntersectingWin

Window function that assigns each geometry a cluster id based on transitive intersection with neighbouring geometries.

Clustering
PostGIS

ST_ClusterKMeans

Window function that partitions geometries into k clusters using the K-Means algorithm with optional weights.

Clustering
PostGIS

ST_ClusterWithin

Aggregate function that clusters input geometries into groups where every member is within a given distance of at least one other.

Clustering
PostGIS

ST_ClusterWithinWin

Window function that assigns each geometry a cluster id based on single-linkage clustering within a distance threshold.

Clustering
PostGIS

ST_Collect

Returns a GeometryCollection or Multi* geometry built from a set of input geometries without merging or dissolving them.

Geometry Constructors
PostGIS

ST_CollectionExtract

Returns only the components of a specified type from a GeometryCollection, as a Multi-geometry.

Geometry Editors
PostGIS

ST_CollectionHomogenize

Returns the simplest representation of a geometry collection, collapsing single-type collections to Multi or single geometries.

Geometry Editors
PostGIS

ST_ConcaveHull

Returns a concave hull polygon that tightly wraps the input geometry, controlled by a target percentage parameter.

Geometry Processing
PostGIS

ST_Contains

Returns true when geometry A completely contains geometry B, with no part of B lying outside A.

Spatial Relationships
PostGIS

ST_ContainsProperly

Returns true when every point of geometry B lies in the interior of geometry A, with no boundary contact.

Spatial Relationships
PostGIS

ST_ConvexHull

Returns the convex hull of a geometry — the smallest convex polygon that contains all input points.

Geometry Processing
PostGIS

ST_CoordDim

Returns the coordinate dimension of a geometry (2, 3, or 4), counting X, Y, optional Z, and optional M.

Geometry Accessors
PostGIS

ST_CoverageInvalidEdges

Window function that returns the edges of a polygonal coverage that violate validity rules (gaps or overlaps).

Coverages
PostGIS

ST_CoverageSimplify

Window function that simplifies a polygonal coverage while preserving shared borders between adjacent polygons.

Coverages
PostGIS

ST_CoverageUnion

Efficiently unions a set of polygons that form a valid coverage, leveraging their topological alignment for speed.

Coverages
PostGIS

ST_CoveredBy

Returns true when no point of geometry A lies outside geometry B, including when A sits on B's boundary.

Spatial Relationships
PostGIS

ST_Covers

Returns true when no point of geometry B lies outside geometry A, including when B touches A's boundary.

Spatial Relationships
PostGIS

ST_CPAWithin

Returns true when two trajectories come within a specified distance of each other at their closest point of approach.

Trajectory
PostGIS

ST_Crosses

Returns true when two geometries share some but not all interior points and their intersection has lower dimension than at least one input.

Spatial Relationships
PostGIS

ST_CurveToLine

Converts a curved geometry to a LineString approximation with configurable tolerance.

Geometry Editors
PostGIS

ST_DelaunayTriangles

Computes a Delaunay triangulation of the input vertices, returned as a collection of triangles or edges.

Geometry Processing
PostGIS

ST_DFullyWithin

Returns true if every point of two geometries is within a given distance of the other — based on maximum distance.

Distance Relationships
PostGIS

ST_Difference

Returns the part of one geometry that does not intersect another — the set-theoretic difference.

Overlay
PostGIS

ST_Dimension

Returns the topological dimension of a geometry — 0 for points, 1 for lines, 2 for polygons.

Geometry Accessors
PostGIS

ST_Disjoint

Returns true when two geometries have no points in common — the exact logical negation of ST_Intersects.

Spatial Relationships
PostGIS

ST_Distance

Returns the minimum 2D distance between two geometries, in CRS units for geometry and metres for geography.

Measurement
PostGIS

ST_DistanceCPA

Returns the minimum 3D distance achieved by two trajectories at their closest point of approach.

Trajectory
PostGIS

ST_DistanceSphere

Returns the minimum great-circle distance in metres between two lon/lat geometries on a sphere.

Measurement
PostGIS

ST_DistanceSpheroid

Returns the minimum distance in metres between two lon/lat geometries on a specified reference spheroid.

Measurement
PostGIS

ST_Dump

Set-returning function that decomposes a geometry into its component simple geometries, returning one row per part.

Geometry Accessors
PostGIS

ST_DumpPoints

Set-returning function that returns every vertex of a geometry as an individual Point with its path.

Geometry Accessors
PostGIS

ST_DumpRings

Set-returning function that returns each ring (exterior plus holes) of a Polygon as a separate single-ring Polygon.

Geometry Accessors
PostGIS

ST_DumpSegments

Set-returning function that emits each line segment of a geometry as an individual two-point LineString; added in PostGIS 3.2.

Geometry Accessors
PostGIS

ST_DWithin

Returns true if two geometries are within a given distance — index-accelerated and the right filter for proximity joins.

Distance Relationships
PostGIS

ST_EndPoint

Returns the last Point of a LineString; NULL for non-LineString inputs in most PostGIS versions.

Geometry Accessors
PostGIS

ST_Envelope

Returns the minimum axis-aligned bounding box of a geometry as a Polygon.

Geometry Accessors
PostGIS

ST_Equals

Returns true when two geometries are spatially equal — the same set of points, regardless of vertex order or representation.

Spatial Relationships
PostGIS

ST_EstimatedExtent

Returns an approximate 2D extent of a geometry column based on PostgreSQL table statistics.

Bounding Box
PostGIS

ST_Expand

Returns a bounding box expanded outward by a fixed distance in each direction — cheaper than ST_Buffer for index-time filters.

Bounding Box
PostGIS

ST_Extent

Aggregate function that returns the 2D bounding box covering every geometry in the input set.

Bounding Box
PostGIS

ST_ExteriorRing

Returns the outer shell of a Polygon as a closed LineString; NULL for non-Polygon inputs.

Geometry Accessors
PostGIS

ST_FilterByM

Filters vertices of a geometry by M-value, keeping only those whose measure lies within the supplied range.

Geometry Processing
PostGIS

ST_FlipCoordinates

Returns a geometry with the X and Y axes flipped, fixing data loaded in lat/lon order.

Geometry Editors
PostGIS

ST_Force2D

Forces a geometry into 2D mode, removing any Z and M coordinates.

Geometry Editors
PostGIS

ST_Force3D

Forces a geometry into XYZ mode. Alias for ST_Force3DZ that sets Z to 0 or a user-supplied value.

Geometry Editors
PostGIS

ST_Force3DM

Forces a geometry into XYM mode, adding M = 0 (or a supplied value) and dropping any Z ordinates.

Geometry Editors
PostGIS

ST_Force3DZ

Forces a geometry into XYZ mode, adding Z = 0 (or a supplied value) to any 2D vertices.

Geometry Editors
PostGIS

ST_Force4D

Forces a geometry into XYZM mode, adding Z and M defaults (or user-supplied values) to missing ordinates.

Geometry Editors
PostGIS

ST_ForceCollection

Wraps any geometry in a GeometryCollection, producing a single-element collection for non-collection inputs.

Geometry Editors
PostGIS

ST_ForceCurve

Upcasts a straight geometry to its curve-enabled equivalent type.

Geometry Editors
PostGIS

ST_ForcePolygonCCW

Forces polygon exteriors to be counter-clockwise and interiors (holes) to be clockwise.

Geometry Editors
PostGIS

ST_ForcePolygonCW

Forces polygon exteriors to be clockwise and interiors (holes) to be counter-clockwise.

Geometry Editors
PostGIS

ST_ForceRHR

Forces polygon orientation to follow the right-hand rule (exterior rings clockwise).

Geometry Editors
PostGIS

ST_ForceSFS

Downcasts a geometry to OGC Simple Features compliance, removing curves and higher dimensions.

Geometry Editors
PostGIS

ST_FrechetDistance

Returns the Frechet distance between two geometries, a shape-similarity metric accounting for point ordering.

Measurement
PostGIS

ST_GeneratePoints

Generates a multipoint of pseudo-random points distributed uniformly inside a polygon or multipolygon.

Geometry Processing
PostGIS

ST_GeogFromText

Constructs a geography value from a well-known text (WKT) or extended WKT representation.

Geometry Input
PostGIS

ST_GeogFromWKB

Constructs a geography value from a well-known binary (WKB) or extended WKB input.

Geometry Input
PostGIS

ST_GeographyFromText

Constructs a geography value from a well-known text (WKT) or extended WKT representation.

Geometry Input
PostGIS

ST_GeomCollFromText

Constructs a GeometryCollection from WKT, optionally with an SRID.

Geometry Input
PostGIS

ST_GeometricMedian

Returns the geometric median of a MultiPoint — the point minimising the sum of distances to all input points.

Geometry Processing
PostGIS

ST_GeometryFromText

OGC-compliant alias of ST_GeomFromText — constructs a geometry from a WKT string.

Geometry Input
PostGIS

ST_GeometryN

Returns the Nth component geometry of a Multi* or GeometryCollection, or the geometry itself if single.

Geometry Accessors
PostGIS

ST_GeometryType

Returns the SQL/MM-style geometry type of a PostGIS geometry as a string prefixed with ST_.

Geometry Accessors
PostGIS

ST_GeomFromEWKB

Constructs a geometry from a PostGIS-extended WKB byte string that includes SRID and Z/M data.

Geometry Input
PostGIS

ST_GeomFromEWKT

Constructs a geometry from extended WKT (EWKT), which supports SRID prefixes and Z/M ordinates.

Geometry Input
PostGIS

ST_GeomFromGeoHash

Returns a polygon geometry for the cell represented by a GeoHash string.

Geometry Input
PostGIS

ST_GeomFromGeoJSON

Constructs a PostGIS geometry from a GeoJSON geometry representation.

Geometry Input
PostGIS

ST_GeomFromGML

Constructs a PostGIS geometry from a GML (Geography Markup Language) XML representation.

Geometry Input
PostGIS

ST_GeomFromKML

Constructs a PostGIS geometry from a KML XML representation in WGS84.

Geometry Input
PostGIS

ST_GeomFromMARC21

Constructs a PostGIS geometry from a MARC21/XML bibliographic record's geographic data. Available from PostGIS 3.3.

Geometry Input
PostGIS

ST_GeomFromText

Constructs a geometry from a well-known text (WKT) string with an optional SRID.

Geometry Input
PostGIS

ST_GeomFromTWKB

Constructs a geometry from Tiny WKB (TWKB), a compact binary encoding for geometry.

Geometry Input
PostGIS

ST_GeomFromWKB

Constructs a geometry from a well-known binary (WKB) byte string, optionally with an SRID.

Geometry Input
PostGIS

ST_GMLToSQL

SQL/MM alias of ST_GeomFromGML — constructs a geometry from GML text.

Geometry Input
PostGIS

ST_HasArc

Returns true if the geometry contains a circular-arc component (CircularString, CurvePolygon, or CompoundCurve).

Geometry Accessors
PostGIS

ST_HausdorffDistance

Returns the Hausdorff distance between two geometries, a shape-similarity metric.

Measurement
PostGIS

ST_Hexagon

Returns a single hexagon polygon at the given grid coordinate and size; added in PostGIS 3.1.

Geometry Constructors
PostGIS

ST_HexagonGrid

Set-returning function that produces a tessellated hexagon grid covering a geometry's bounding box; added in PostGIS 3.1.

Geometry Constructors
PostGIS

ST_InteriorRingN

Returns the Nth interior ring (hole) of a Polygon as a closed LineString; NULL for non-Polygon inputs.

Geometry Accessors
PostGIS

ST_InterpolatePoint

Returns the interpolated measure (M) of a point when projected onto a measure-parameterised linestring.

Linear Referencing
PostGIS

ST_Intersection

Returns the shared portion of two geometries — the set-theoretic intersection.

Overlay
PostGIS

ST_Intersects

Returns true when two geometries share any portion of space — the most commonly used spatial predicate in PostGIS.

Spatial Relationships
PostGIS

ST_InverseTransformPipeline

Applies the inverse of a PROJ coordinate transformation pipeline to a geometry. Available from PostGIS 3.4.

Spatial Reference System
PostGIS

ST_IsClosed

Returns true if a LineString or MultiLineString is closed — i.e. start and end points coincide.

Geometry Accessors
PostGIS

ST_IsCollection

Returns true if the geometry is a collection type (Multi* or GeometryCollection) regardless of how many components it has.

Geometry Accessors
PostGIS

ST_IsEmpty

Returns true if a geometry is empty (has no coordinates), regardless of its type.

Geometry Accessors
PostGIS

ST_IsPolygonCCW

Returns true if the exterior ring of a Polygon is oriented counter-clockwise and interior rings are clockwise.

Geometry Accessors
PostGIS

ST_IsPolygonCW

Returns true if the exterior ring of a Polygon is oriented clockwise and interior rings are counter-clockwise.

Geometry Accessors
PostGIS

ST_IsRing

Returns true if a LineString is both closed (start equals end) and simple (non-self-intersecting).

Geometry Accessors
PostGIS

ST_IsSimple

Returns true if a geometry has no anomalous geometric points such as self-intersections or self-tangency.

Geometry Accessors
PostGIS

ST_IsValid

Tests whether a geometry is well-formed and simple according to the OGC Simple Features specification.

Geometry Validation
PostGIS

ST_IsValidDetail

Returns a composite row detailing whether a geometry is valid, the reason if not, and a location point.

Geometry Validation
PostGIS

ST_IsValidReason

Returns a text string with the reason why a geometry is invalid, or "Valid Geometry" if valid.

Geometry Validation
PostGIS

ST_IsValidTrajectory

Returns true when a measured linestring is a valid trajectory — that is, its M values are strictly increasing.

Trajectory
PostGIS

ST_LargestEmptyCircle

Returns the largest circle containing none of the input geometry's obstacles, optionally bounded by a boundary polygon.

Geometry Processing
PostGIS

ST_Length

Returns the 2D length of a linear geometry, in CRS units for geometry and metres for geography.

Measurement
PostGIS

ST_Length2D

Returns the 2D length of a linear geometry; alias of ST_Length for geometry input.

Measurement
PostGIS

ST_LengthSpheroid

Returns the 2D or 3D length of a lon/lat geometry measured on a specified reference spheroid.

Measurement
PostGIS

ST_Letters

Returns a geometry representing rendered text letters using the default Unicode font; added in PostGIS 3.3.

Geometry Constructors
PostGIS

ST_LineCrossingDirection

Returns an integer encoding how two linestrings cross — no crossing, left, right, or multi-cross.

Spatial Relationships
PostGIS

ST_LineExtend

Extends a LineString at its endpoints by a specified distance, in CRS units. Available from PostGIS 3.4.

Geometry Editors
PostGIS

ST_LineFromEncodedPolyline

Constructs a LineString from a Google encoded polyline string.

Geometry Input
PostGIS

ST_LineFromMultiPoint

Creates a LineString from a MultiPoint geometry by connecting its points in order.

Geometry Constructors
PostGIS

ST_LineFromText

Constructs a LineString from WKT, raising an error if the WKT is not a LineString.

Geometry Input
PostGIS

ST_LineFromWKB

Constructs a LineString from WKB, raising an error if the WKB is not a LineString.

Geometry Input
PostGIS

ST_LineInterpolatePoint

Returns a point interpolated along a linestring at a fractional distance between 0 and 1.

Linear Referencing
PostGIS

ST_LineInterpolatePoints

Returns multiple points interpolated along a linestring at regular fractional intervals.

Linear Referencing
PostGIS

ST_LineLocatePoint

Returns the fractional position of the closest point on a linestring to a given point.

Linear Referencing
PostGIS

ST_LineMerge

Stitches connected lines in a MultiLineString into the longest possible LineStrings by joining shared endpoints.

Geometry Processing
PostGIS

ST_LinestringFromWKB

Alias of ST_LineFromWKB — constructs a LineString from WKB.

Geometry Input
PostGIS

ST_LineSubstring

Returns the portion of a linestring between two fractional positions.

Linear Referencing
PostGIS

ST_LineToCurve

Detects circular arcs in a LineString and rebuilds it as a CircularString, CompoundCurve, or CurvePolygon.

Geometry Editors
PostGIS

ST_LocateAlong

Returns the locations along a measure-parameterised geometry where a specified M value occurs.

Linear Referencing
PostGIS

ST_LocateBetween

Returns the portions of a measure-parameterised geometry that fall between two measure values.

Linear Referencing
PostGIS

ST_LocateBetweenElevations

Returns the portions of a geometry whose Z values fall between two elevation bounds.

Linear Referencing
PostGIS

ST_LongestLine

Returns the 2D longest line between two geometries as a two-point LINESTRING.

Measurement
PostGIS

ST_M

Returns the M (measure) coordinate of a Point geometry, or NULL if absent.

Geometry Accessors
PostGIS

ST_MakeBox2D

Constructs a 2D box2d from two corner points.

Bounding Box
PostGIS

ST_MakeEnvelope

Constructs a rectangular Polygon from minimum and maximum X/Y coordinates and an optional SRID.

Geometry Constructors
PostGIS

ST_MakeLine

Builds a LineString from two points, an array of points, or an aggregated ordered set of point geometries.

Geometry Constructors
PostGIS

ST_MakePoint

Creates a 2D, 3D, or 4D Point geometry from numeric coordinates; returns SRID=0 unless set explicitly.

Geometry Constructors
PostGIS

ST_MakePointM

Creates a Point with X, Y, and an M (measure) coordinate but no Z value.

Geometry Constructors
PostGIS

ST_MakePolygon

Creates a Polygon from a closed LineString outer shell and an optional array of inner-ring holes.

Geometry Constructors
PostGIS

ST_MakeValid

Attempts to repair invalid geometry, returning a valid geometry that preserves the input's vertices.

Geometry Validation
PostGIS

ST_MaxDistance

Returns the 2D maximum distance between two geometries in projected CRS units.

Measurement
PostGIS

ST_MaximumInscribedCircle

Returns the largest circle that fits entirely inside a polygon, together with its centre point and radius.

Geometry Processing
PostGIS

ST_MemSize

Returns the total in-memory byte size of a geometry including headers and bounding box.

Geometry Accessors
PostGIS

ST_MemUnion

Memory-frugal aggregate that unions geometries one at a time, trading speed for lower memory usage.

Overlay
PostGIS

ST_MinimumBoundingCircle

Returns the smallest circle containing the input geometry, approximated as a polygon.

Geometry Processing
PostGIS

ST_MinimumBoundingRadius

Returns the centre point and radius of the smallest circle containing the input geometry.

Geometry Processing
PostGIS

ST_MinimumClearance

Returns the minimum clearance of a geometry, a measure of its robustness to coordinate perturbation.

Measurement
PostGIS

ST_MinimumClearanceLine

Returns the two-point LINESTRING spanning a geometry's minimum clearance, showing the at-risk vertex and segment.

Measurement
PostGIS

ST_MLineFromText

Constructs a MultiLineString from WKT, raising an error if the WKT is not a MultiLineString.

Geometry Input
PostGIS

ST_MPointFromText

Constructs a MultiPoint from WKT, raising an error if the WKT is not a MultiPoint.

Geometry Input
PostGIS

ST_MPolyFromText

Constructs a MultiPolygon from WKT, raising an error if the WKT is not a MultiPolygon.

Geometry Input
PostGIS

ST_Multi

Returns the geometry as a MULTI-geometry type (MultiPoint, MultiLineString, or MultiPolygon).

Geometry Editors
PostGIS

ST_NDims

Returns the coordinate dimension (2, 3, or 4) of a geometry, counting X, Y, optional Z, and optional M.

Geometry Accessors
PostGIS

ST_Node

Nodes a set of linestrings by splitting them at all intersection points, producing a noded MULTILINESTRING.

Overlay
PostGIS

ST_Normalize

Returns the canonical form of a geometry, useful for comparing geometries by value.

Geometry Editors
PostGIS

ST_NPoints

Returns the total number of points (vertices) in a geometry across all parts and rings.

Geometry Accessors
PostGIS

ST_NRings

Returns the total number of rings (exterior plus all interiors) across all parts of a Polygon or MultiPolygon.

Geometry Accessors
PostGIS

ST_NumGeometries

Returns the number of component geometries in a Multi* or GeometryCollection; 1 for simple geometries.

Geometry Accessors
PostGIS

ST_NumInteriorRing

Alias of ST_NumInteriorRings; returns the number of interior rings (holes) in a Polygon.

Geometry Accessors
PostGIS

ST_NumInteriorRings

Returns the number of interior rings (holes) in a single Polygon; NULL for non-Polygon inputs.

Geometry Accessors
PostGIS

ST_NumPatches

Returns the number of patches (faces) in a PolyhedralSurface or TIN geometry.

Geometry Accessors
PostGIS

ST_NumPoints

Returns the number of points in a LineString or CircularString; NULL for other geometry types.

Geometry Accessors
PostGIS

ST_OffsetCurve

Returns a line parallel to the input at a signed distance, with configurable join, quad_segs, and mitre limit.

Geometry Processing
PostGIS

ST_OrderingEquals

Returns true when two geometries are identical and their points are stored in the same order.

Spatial Relationships
PostGIS

ST_OrientedEnvelope

Returns the minimum-area rotated bounding rectangle that contains the input geometry.

Geometry Processing
PostGIS

ST_Overlaps

Returns true when two geometries of the same dimension partially overlap but neither contains the other.

Spatial Relationships
PostGIS

ST_PatchN

Returns the Nth patch of a PolyhedralSurface or TIN geometry as a Polygon; 1-based index.

Geometry Accessors
PostGIS

ST_Perimeter

Returns the 2D perimeter of a polygonal geometry; in CRS units for geometry and metres for geography.

Measurement
PostGIS

ST_Perimeter2D

Returns the 2D perimeter of a polygonal geometry; alias of ST_Perimeter for geometry input.

Measurement
PostGIS

ST_Point

Creates a 2D Point from X and Y coordinates with an optional SRID argument; preferred modern constructor in PostGIS 3.2+.

Geometry Constructors
PostGIS

ST_PointFromGeoHash

Returns the centre point of the GeoHash cell represented by the input string.

Geometry Input
PostGIS

ST_PointFromText

Constructs a Point from WKT, raising an error if the WKT is not a Point.

Geometry Input
PostGIS

ST_PointFromWKB

Constructs a Point from WKB, raising an error if the WKB is not a Point.

Geometry Input
PostGIS

ST_PointInsideCircle

Returns true if a POINT geometry lies inside a circle defined by centre coordinates and a radius.

Distance Relationships
PostGIS

ST_PointM

Creates a Point with X, Y, and M (measure) coordinates and an explicit SRID; available in PostGIS 3.2+.

Geometry Constructors
PostGIS

ST_PointN

Returns the Nth point of a LineString or CircularString as a Point; supports negative indices.

Geometry Accessors
PostGIS

ST_PointOnSurface

Returns a point guaranteed to lie inside the input polygon or on the input geometry.

Geometry Processing
PostGIS

ST_Points

Returns a MultiPoint containing every vertex of the input geometry, including duplicates.

Geometry Accessors
PostGIS

ST_PointZ

Creates a 3D Point with X, Y, Z coordinates and an explicit SRID; available in PostGIS 3.2+.

Geometry Constructors
PostGIS

ST_PointZM

Creates a 4D Point with X, Y, Z, M coordinates and an explicit SRID; available in PostGIS 3.2+.

Geometry Constructors
PostGIS

ST_Polygon

Creates a simple Polygon from a closed LineString and an explicit SRID; does not accept interior holes.

Geometry Constructors
PostGIS

ST_PolygonFromText

Constructs a Polygon from WKT, raising an error if the WKT is not a Polygon.

Geometry Input
PostGIS

ST_Polygonize

Aggregates linework into every polygonal face that can be formed, returning a GeometryCollection of polygons.

Geometry Processing
PostGIS

ST_Project

Returns a point projected from a start point by a distance and azimuth. Geography from PostGIS 2.4; geometry from 3.4.

Geometry Editors
PostGIS

ST_QuantizeCoordinates

Sets trailing bits of coordinate mantissas to zero to improve compression, without creating invalid geometry.

Geometry Editors
PostGIS

ST_ReducePrecision

Snaps vertices to a precision grid while preserving validity, using GEOS's topology-preserving precision reducer.

Geometry Processing
PostGIS

ST_Relate

Tests or returns the Dimensionally Extended 9-Intersection Model matrix describing how two geometries relate topologically.

DE-9IM
PostGIS

ST_RelateMatch

Returns true if a DE-9IM intersection matrix satisfies a given intersection matrix pattern.

DE-9IM
PostGIS

ST_RemovePoint

Removes a point from a LineString at the specified zero-based vertex index.

Geometry Editors
PostGIS

ST_RemoveRepeatedPoints

Removes duplicate consecutive vertices from a geometry, optionally within a tolerance.

Geometry Editors
PostGIS

ST_Reverse

Returns a geometry with its vertex order reversed.

Geometry Editors
PostGIS

ST_Rotate

Rotates a geometry counter-clockwise about a specified origin by the given angle in radians.

Affine Transformations
PostGIS

ST_RotateX

Rotates a geometry about the X axis by the given angle in radians, affecting Y and Z coordinates.

Affine Transformations
PostGIS

ST_RotateY

Rotates a geometry about the Y axis by the given angle in radians, affecting X and Z coordinates.

Affine Transformations
PostGIS

ST_RotateZ

Rotates a geometry about the Z axis by the given angle in radians — equivalent to 2D rotation about the origin.

Affine Transformations
PostGIS

ST_Scale

Scales a geometry by factors along the X, Y, and optionally Z axes, optionally about a supplied origin.

Affine Transformations
PostGIS

ST_Scroll

Changes the start/end point of a closed LineString to the specified point. Available from PostGIS 3.2.

Geometry Editors
PostGIS

ST_Segmentize

Returns a modified geometry having no segment longer than the given distance.

Geometry Editors
PostGIS

ST_SetEffectiveArea

Stores each vertex's Visvalingam-Whyatt effective area as its M-value, enabling progressive simplification.

Geometry Processing
PostGIS

ST_SetPoint

Replaces the point at the specified zero-based index of a LineString with a new point.

Geometry Editors
PostGIS

ST_SetSRID

Sets the SRID of a geometry without reprojecting its coordinates.

Spatial Reference System
PostGIS

ST_SharedPaths

Returns the collection of shared edges between two line or multiline geometries, grouped by direction.

Geometry Processing
PostGIS

ST_ShiftLongitude

Shifts longitudes in a geometry from the -180..180 range to the 0..360 range (and vice versa).

Geometry Editors
PostGIS

ST_ShortestLine

Returns the 2D shortest LINESTRING between two geometries; its length equals ST_Distance.

Measurement
PostGIS

ST_Simplify

Simplifies a geometry using the Douglas-Peucker algorithm with a given tolerance, without preserving topology.

Geometry Processing
PostGIS

ST_SimplifyPolygonHull

Simplifies a polygon while preserving topology, producing either an inner or outer hull controlled by a vertex ratio.

Geometry Processing
PostGIS

ST_SimplifyPreserveTopology

Simplifies a geometry with Douglas-Peucker while guaranteeing the result remains a valid geometry.

Geometry Processing
PostGIS

ST_SimplifyVW

Simplifies a geometry using the Visvalingam-Whyatt algorithm, removing vertices with the smallest effective triangular area.

Geometry Processing
PostGIS

ST_Snap

Snaps the vertices and segments of a geometry to another geometry's vertices within a tolerance.

Geometry Editors
PostGIS

ST_SnapToGrid

Snaps all points of a geometry to a regular grid defined by origin and cell size.

Geometry Editors
PostGIS

ST_Split

Splits a geometry by a cutting geometry and returns the resulting pieces as a GEOMETRYCOLLECTION.

Overlay
PostGIS

ST_Square

Returns a single square polygon at the given grid coordinate and size; added in PostGIS 3.1.

Geometry Constructors
PostGIS

ST_SquareGrid

Set-returning function that produces a square fishnet grid covering a geometry's bounding box; added in PostGIS 3.1.

Geometry Constructors
PostGIS

ST_SRID

Returns the spatial reference identifier (SRID) of a geometry as defined in the spatial_ref_sys table.

Spatial Reference System
PostGIS

ST_StartPoint

Returns the first Point of a LineString; NULL for non-LineString inputs in most PostGIS versions.

Geometry Accessors
PostGIS

ST_Subdivide

Returns a set of smaller geometries produced by recursively splitting the input until each piece has at most max_vertices.

Overlay
PostGIS

ST_Summary

Returns a human-readable multi-line text summary of a geometry including type, dimension, vertex count, and bbox.

Geometry Accessors
PostGIS

ST_SwapOrdinates

Swaps two ordinates of a geometry — e.g. X and Y, or Z and M. Available from PostGIS 2.2.

Geometry Editors
PostGIS

ST_SymDifference

Returns the symmetric difference of two geometries — parts in exactly one of the two but not both.

Overlay
PostGIS

ST_TileEnvelope

Returns the Web Mercator bounding box polygon for an XYZ tile coordinate; added in PostGIS 3.0.

Geometry Constructors
PostGIS

ST_Touches

Returns true when two geometries share only boundary points and no interior points.

Spatial Relationships
PostGIS

ST_Transform

Reprojects a geometry from its current SRID to the specified target SRID.

Spatial Reference System
PostGIS

ST_TransformPipeline

Transforms a geometry through a user-defined PROJ coordinate operation pipeline. Available from PostGIS 3.4.

Spatial Reference System
PostGIS

ST_Translate

Shifts every vertex of a geometry by the given X, Y, and optionally Z offsets.

Affine Transformations
PostGIS

ST_TransScale

Translates a geometry by the given offsets, then scales it by the given factors — a convenience for the common trans-then-scale combo.

Affine Transformations
PostGIS

ST_TriangulatePolygon

Computes a constrained Delaunay triangulation of a polygon, returning triangles that tile the polygon's interior.

Geometry Processing
PostGIS

ST_UnaryUnion

Unions the components of a single geometry, dissolving overlaps and splitting at self-intersections.

Overlay
PostGIS

ST_Union

Returns the set-theoretic union of geometries, available as a two-argument function and as an aggregate.

Overlay
PostGIS

ST_VoronoiLines

Returns the Voronoi diagram edges computed from a set of input points, as a MultiLineString.

Geometry Processing
PostGIS

ST_VoronoiPolygons

Returns the Voronoi diagram of a set of points as a collection of polygons, one per input point.

Geometry Processing
PostGIS

ST_Within

Returns true when geometry A lies completely inside geometry B, with at least one shared interior point.

Spatial Relationships
PostGIS

ST_WKBToSQL

SQL/MM alias of ST_GeomFromWKB — constructs a geometry from WKB.

Geometry Input
PostGIS

ST_WKTToSQL

SQL/MM alias of ST_GeomFromText — constructs a geometry from a WKT string.

Geometry Input
PostGIS

ST_WrapX

Wraps a geometry around a specified X value, moving parts past that value by a given offset.

Geometry Editors
PostGIS

ST_X

Returns the X coordinate of a Point geometry as a double-precision number.

Geometry Accessors
PostGIS

ST_XMax

Returns the maximum X coordinate of a geometry's bounding box.

Bounding Box
PostGIS

ST_XMin

Returns the minimum X coordinate of a geometry's bounding box.

Bounding Box
PostGIS

ST_Y

Returns the Y coordinate of a Point geometry as a double-precision number.

Geometry Accessors
PostGIS

ST_YMax

Returns the maximum Y coordinate of a geometry's bounding box.

Bounding Box
PostGIS

ST_YMin

Returns the minimum Y coordinate of a geometry's bounding box.

Bounding Box
PostGIS

ST_Z

Returns the Z (elevation) coordinate of a Point geometry, or NULL if absent.

Geometry Accessors
PostGIS

ST_ZMax

Returns the maximum Z coordinate of a geometry's 3D bounding box.

Bounding Box
PostGIS

ST_Zmflag

Returns a smallint (0, 1, 2, 3) indicating presence of Z and M dimensions — 0=2D, 1=3DM, 2=3DZ, 3=4D.

Geometry Accessors
PostGIS

ST_ZMin

Returns the minimum Z coordinate of a geometry's 3D bounding box.

Bounding Box
Turf.js

turf.along

Takes a LineString and returns a Point at a specified distance along the line measured geodetically on the WGS84 ellipsoid.

Measurement
Turf.js

turf.area

Computes the geodesic area in square meters of one or more GeoJSON polygons using the WGS84 ellipsoid.

Measurement
Turf.js

turf.bbox

Calculates the bounding box of any GeoJSON Feature, FeatureCollection, or Geometry as a [minX, minY, maxX, maxY] array.

Measurement
Turf.js

turf.bboxClip

Clips a LineString or Polygon to a bounding box using the Cohen-Sutherland algorithm, trimming coordinates outside the extent.

Transformation
Turf.js

turf.bboxPolygon

Converts a bounding box array into a rectangular GeoJSON Polygon Feature with five coordinates forming a closed ring.

Measurement
Turf.js

turf.bearing

Calculates the geodesic initial bearing in degrees between two GeoJSON points, measured clockwise from true north.

Measurement
Turf.js

turf.bezierSpline

Returns a smoothed LineString by interpolating a bezier spline through the original vertices.

Transformation
Turf.js

turf.booleanClockwise

Returns true if a ring is wound clockwise, false if counter-clockwise, useful for enforcing GeoJSON winding rules.

Booleans
Turf.js

turf.booleanConcave

Returns true if a Polygon is concave, false if convex — useful for routing and validation decisions.

Booleans
Turf.js

turf.booleanContains

Returns true if geometry a fully contains geometry b, with matching interiors and no part of b touching the exterior of a.

Booleans
Turf.js

turf.booleanCrosses

Returns true if two geometries cross — their intersection is lower-dimensional than both and interior to each.

Booleans
Turf.js

turf.booleanDisjoint

Returns true if two geometries share no points at all — the exact complement of intersects.

Booleans
Turf.js

turf.booleanEqual

Returns true if two geometries of the same type have identical coordinates within a configurable precision.

Booleans
Turf.js

turf.booleanIntersects

Returns true if two geometries share any point at all, covering the full range of OGC intersection cases.

Booleans
Turf.js

turf.booleanOverlap

Returns true if two same-dimension geometries share area or length without either fully containing the other.

Booleans
Turf.js

turf.booleanParallel

Returns true if every segment of one LineString is parallel to the corresponding segment of another LineString.

Booleans
Turf.js

turf.booleanPointInPolygon

Returns true if a Point is inside a Polygon or MultiPolygon, with support for holes and an option to exclude the boundary.

Booleans
Turf.js

turf.booleanPointOnLine

Returns true if a Point lies on a LineString within a configurable tolerance, with an option to ignore the endpoints.

Booleans
Turf.js

turf.booleanTouches

Returns true if two geometries share only boundary points and no interior points.

Booleans
Turf.js

turf.booleanValid

Returns true if a GeoJSON Feature or Geometry conforms to the OGC Simple Feature Specification.

Booleans
Turf.js

turf.booleanWithin

Returns true if geometry a is fully inside geometry b — the inverse of booleanContains.

Booleans
Turf.js

turf.buffer

Calculates a buffer for a given GeoJSON Feature, FeatureCollection, or Geometry for a specified distance and units.

Geometry Processing
Turf.js

turf.center

Returns the absolute center point of a GeoJSON Feature or FeatureCollection based on the midpoint of its bounding box.

Measurement
Turf.js

turf.centerOfMass

Computes the polygon center of mass using the signed-area method, returning the geometric centroid weighted by area.

Measurement
Turf.js

turf.centroid

Returns the mean of all vertices in a GeoJSON Feature as a Point, a quick but density-sensitive centroid.

Measurement
Turf.js

turf.circle

Returns a regular Polygon approximating a circle of the given radius around a centre Point, using the WGS84 sphere.

Transformation
Turf.js

turf.cleanCoords

Removes redundant coordinates from a GeoJSON Feature, including duplicates and colinear points on lines and polygons.

Coordinate Mutation
Turf.js

turf.clone

Returns a deep copy of a GeoJSON Feature, FeatureCollection, or Geometry, faster than JSON.parse(JSON.stringify(...)).

Transformation
Turf.js

turf.clusterEach

Iterates over each unique cluster in a FeatureCollection, invoking a callback per cluster with the member features and the cluster value.

Meta
Turf.js

turf.clusterReduce

Reduces every cluster in a FeatureCollection to a single accumulated value, grouping by a named property.

Meta
Turf.js

turf.collect

Aggregates a property from points that fall inside each polygon into an array on the polygon feature.

Aggregation
Turf.js

turf.collectionOf

Throws if a FeatureCollection does not contain Features of the expected geometry type, used for runtime input validation inside Turf helpers.

Assertions
Turf.js

turf.combine

Combines Point, LineString, or Polygon features into their respective Multi versions in a single FeatureCollection.

Feature Conversion
Turf.js

turf.concave

Computes a concave hull Polygon around a set of GeoJSON Points using the alpha-shape algorithm with a tunable maxEdge parameter.

Transformation
Turf.js

turf.containsNumber

Returns true if a (possibly nested) coordinate array contains a number — a fast, low-level coordinate shape check.

Assertions
Turf.js

turf.convex

Returns the convex hull Polygon of a set of GeoJSON features using the Andrew's monotone chain algorithm.

Transformation
Turf.js

turf.coordAll

Returns a flat array of every coordinate position found in any GeoJSON Feature, FeatureCollection, or Geometry.

Meta
Turf.js

turf.coordEach

Iterates over every coordinate position in any GeoJSON object, invoking a callback with the position and its structural indices.

Meta
Turf.js

turf.coordReduce

Reduces every coordinate in a GeoJSON object to a single accumulated value, similar to Array.reduce but traversing all positions.

Meta
Turf.js

turf.destination

Returns the destination Point given a start point, distance, and bearing along a great-circle path on the WGS84 ellipsoid.

Measurement
Turf.js

turf.difference

Returns the polygon difference (A minus B) between two GeoJSON polygons using Martinez-Rueda polygon clipping.

Transformation
Turf.js

turf.dissolve

Merges adjacent polygons in a FeatureCollection that share edges, optionally filtering by a property key.

Transformation
Turf.js

turf.distance

Computes the great-circle distance between two GeoJSON points using the haversine formula on the WGS84 sphere.

Measurement
Turf.js

turf.envelope

Returns the rectangular bounding Polygon of any GeoJSON input, equivalent to bboxPolygon(bbox(input)).

Measurement
Turf.js

turf.explode

Extracts every coordinate from a GeoJSON input and returns them as a FeatureCollection of Point features.

Feature Conversion
Turf.js

turf.feature

Wraps a GeoJSON Geometry into a valid GeoJSON Feature with optional properties, bbox, and id.

Helper
Turf.js

turf.featureCollection

Wraps an array of GeoJSON Feature objects into a valid FeatureCollection with optional bbox and id.

Helper
Turf.js

turf.featureEach

Iterates over each Feature in a GeoJSON object, invoking a callback with the feature and its index.

Meta
Turf.js

turf.featureOf

Throws if a Feature's geometry does not match the expected GeoJSON type, used for input validation inside Turf helpers.

Assertions
Turf.js

turf.featureReduce

Reduces the features of a GeoJSON object to a single value, similar to Array.reduce but accepting any GeoJSON input.

Meta
Turf.js

turf.flatten

Splits Multi geometries in a GeoJSON input into individual single-geometry features, returning a FeatureCollection.

Feature Conversion
Turf.js

turf.flattenEach

Iterates over each flattened single-geometry feature in a GeoJSON object, breaking MultiPoint/MultiLineString/MultiPolygon into parts.

Meta
Turf.js

turf.flattenReduce

Reduces every flattened single-part Feature of a GeoJSON object to a single accumulated value.

Meta
Turf.js

turf.flip

Swaps the coordinate order of every position in a GeoJSON feature, converting between [lng, lat] and [lat, lng].

Coordinate Mutation
Turf.js

turf.geojsonType

Throws if a GeoJSON object's type does not match the expected value, used for input validation inside Turf helpers.

Assertions
Turf.js

turf.geomEach

Iterates over every Geometry in a GeoJSON object, invoking a callback with the geometry and its structural indices.

Meta
Turf.js

turf.geometryCollection

Creates a GeoJSON Feature whose geometry is a GeometryCollection composed of multiple heterogeneous geometries.

Helper
Turf.js

turf.geomReduce

Reduces every Geometry of a GeoJSON object to a single accumulated value, with access to the owning Feature's metadata.

Meta
Turf.js

turf.getCluster

Returns a FeatureCollection containing only the features whose properties match a filter, typically a single cluster id.

Meta
Turf.js

turf.greatCircle

Returns a densified LineString representing the great-circle path between two GeoJSON points, suitable for rendering on maps.

Measurement
Turf.js

turf.hexGrid

Creates a FeatureCollection of flat-topped hexagons (or triangles) covering a bounding box with a given cell size.

Grids
Turf.js

turf.interpolate

Estimates a continuous surface from scattered points using Inverse Distance Weighting and returns a grid of values.

Interpolation
Turf.js

turf.intersect

Returns the polygon intersection of two GeoJSON polygons using the Martinez-Rueda polygon-clipping algorithm.

Transformation
Turf.js

turf.isobands

Generates filled contour bands (isobands) from a gridded FeatureCollection of Points and an array of break values.

Interpolation
Turf.js

turf.isolines

Produces contour lines (isolines) from a gridded FeatureCollection of Points and an array of break values.

Interpolation
Turf.js

turf.kinks

Finds self-intersections (kinks) in a LineString or Polygon and returns them as a FeatureCollection of Points.

Misc
Turf.js

turf.length

Sums the geodesic length of a GeoJSON LineString or MultiLineString using the haversine formula.

Measurement
Turf.js

turf.lineArc

Returns a LineString arc along a circle of given radius between two bearings around a centre point.

Misc
Turf.js

turf.lineChunk

Divides a LineString into equal-length chunks, returning a FeatureCollection of shorter LineString segments.

Misc
Turf.js

turf.lineIntersect

Returns the intersection points of two LineStrings, Polygons, or any combination, as a FeatureCollection of Points.

Misc
Turf.js

turf.lineOffset

Returns a new LineString offset from the original by a given distance, either left or right of the direction of travel.

Transformation
Turf.js

turf.lineOverlap

Returns the coincident segments (overlapping portions) between two LineStrings or line-based features within a tolerance.

Misc
Turf.js

turf.lineSegment

Decomposes any LineString or Polygon feature into its constituent two-vertex segments as a FeatureCollection.

Misc
Turf.js

turf.lineSlice

Returns the sub-LineString between two reference Points that lie on or near a source LineString.

Misc
Turf.js

turf.lineSliceAlong

Returns the sub-LineString between two distances measured along the source line in the chosen units.

Misc
Turf.js

turf.lineSplit

Splits a LineString at every intersection with another feature, returning a FeatureCollection of LineString parts.

Misc
Turf.js

turf.lineString

Creates a GeoJSON LineString Feature from an array of two or more positions with optional properties.

Helper
Turf.js

turf.lineToPolygon

Converts a closed LineString or MultiLineString into a Polygon or MultiPolygon, closing the ring if necessary.

Feature Conversion
Turf.js

turf.mask

Returns a Polygon with a rectangular world outer ring and inner holes formed by the input polygons, useful for inverse fill effects.

Misc
Turf.js

turf.midpoint

Returns the geodesic midpoint Point between two input points along the great-circle path on the WGS84 sphere.

Measurement
Turf.js

turf.multiLineString

Creates a GeoJSON MultiLineString Feature from an array of LineString coordinate arrays with optional properties.

Helper
Turf.js

turf.multiPoint

Creates a GeoJSON MultiPoint Feature from an array of positions with optional properties, bbox, and id.

Helper
Turf.js

turf.multiPolygon

Creates a GeoJSON MultiPolygon Feature from a nested coordinate array, supporting polygons with holes.

Helper
Turf.js

turf.nearestPoint

Returns the closest Point in a FeatureCollection to a target Point, using haversine distance.

Measurement
Turf.js

turf.nearestPointOnLine

Projects a Point onto the nearest position along a LineString and returns that projected Point with distance and index metadata.

Measurement
Turf.js

turf.planepoint

Returns the interpolated z-value at a point inside a triangular polygon whose vertices carry a, b, c properties.

Interpolation
Turf.js

turf.point

Creates a GeoJSON Point Feature from a [lng, lat] position with optional properties, bbox, and id.

Helper
Turf.js

turf.pointGrid

Creates a FeatureCollection of Points arranged in a regular grid across a bounding box with a given cell spacing.

Grids
Turf.js

turf.pointOnFeature

Returns a Point guaranteed to lie on the surface of any GeoJSON Feature, useful for label anchoring on irregular shapes.

Measurement
Turf.js

turf.pointsWithinPolygon

Filters Points or MultiPoints to those falling within one or more Polygons or MultiPolygons.

Joins
Turf.js

turf.pointToLineDistance

Returns the minimum distance from a GeoJSON Point to a LineString in the requested units, optionally using planar or geodesic math.

Measurement
Turf.js

turf.polygon

Creates a GeoJSON Polygon Feature from an array of linear rings, enforcing closure and minimum ring length.

Helper
Turf.js

turf.polygonize

Builds polygons from a network of noded LineStrings, the GeoJSON equivalent of ST_Polygonize in PostGIS.

Feature Conversion
Turf.js

turf.polygonTangents

Finds the two tangent points on a polygon's exterior ring from a given external point, returned as a FeatureCollection of Points.

Measurement
Turf.js

turf.polygonToLine

Converts a Polygon or MultiPolygon to its boundary as a LineString or MultiLineString.

Feature Conversion
Turf.js

turf.propEach

Iterates over the properties object of every Feature in a GeoJSON input, invoking a callback per Feature.

Meta
Turf.js

turf.propReduce

Reduces over the properties objects of every Feature in a GeoJSON input to a single accumulated value.

Meta
Turf.js

turf.randomLineString

Generates a FeatureCollection of random LineString features within a bounding box for prototyping and tests.

Random
Turf.js

turf.randomPoint

Generates a FeatureCollection of random Point features uniformly distributed across a bounding box.

Random
Turf.js

turf.randomPolygon

Generates a FeatureCollection of random Polygon features within a bounding box for testing and prototyping.

Random
Turf.js

turf.randomPosition

Returns a single random [lng, lat] position within an optional bounding box — the low-level building block for Turf's random helpers.

Random
Turf.js

turf.rewind

Rewinds LineString or Polygon geometries to enforce a specific winding order, following or inverting the right-hand rule.

Coordinate Mutation
Turf.js

turf.rhumbBearing

Returns the constant-heading rhumb-line bearing between two GeoJSON points in degrees from true north.

Measurement
Turf.js

turf.rhumbDestination

Returns the destination Point from an origin travelling a distance and constant bearing along a rhumb line.

Measurement
Turf.js

turf.rhumbDistance

Computes the rhumb-line (constant heading) distance between two GeoJSON points in the chosen units.

Measurement
Turf.js

turf.round

Rounds a number to a specified precision, commonly used alongside turf.truncate for coordinate precision management.

Coordinate Mutation
Turf.js

turf.sample

Picks a specified number of random features from a FeatureCollection without replacement and returns them as a new FeatureCollection.

Data
Turf.js

turf.sector

Returns a pie-slice Polygon around a centre point bounded by two bearings and a radius, geodetically computed.

Misc
Turf.js

turf.segmentEach

Iterates over every two-vertex line segment derived from any LineString or Polygon boundary in a GeoJSON object.

Meta
Turf.js

turf.segmentReduce

Reduces every two-vertex line segment of a GeoJSON object to a single accumulated value.

Meta
Turf.js

turf.shortestPath

Returns the shortest path LineString between two Points that avoids a set of Polygon obstacles, computed on a grid-based A* search.

Misc
Turf.js

turf.simplify

Simplifies GeoJSON geometries using the Ramer-Douglas-Peucker algorithm, reducing vertex count while preserving shape.

Transformation
Turf.js

turf.square

Expands a bounding box to the smallest square that contains it, returning a new [minX, minY, maxX, maxY] array.

Measurement
Turf.js

turf.squareGrid

Creates a FeatureCollection of square polygons tiling a bounding box with a given cell size in degrees.

Grids
Turf.js

turf.tag

Performs a spatial join that copies a property from the containing Polygon onto each Point within it.

Joins
Turf.js

turf.tesselate

Triangulates a GeoJSON Polygon using earcut, returning a FeatureCollection of triangle Polygons suitable for rendering.

Transformation
Turf.js

turf.tin

Builds a Triangulated Irregular Network (TIN) from a FeatureCollection of points, returning triangular polygons with per-vertex z-values.

Interpolation
Turf.js

turf.transformRotate

Rotates any GeoJSON Feature by a given angle around a pivot Point, using geodesic math on the WGS84 sphere.

Transformation
Turf.js

turf.transformScale

Scales any GeoJSON Feature by a factor around an origin Point, using geodesic math on the WGS84 sphere.

Transformation
Turf.js

turf.transformTranslate

Moves a GeoJSON Feature a given distance and direction using rhumb-line translation, optionally with a vertical shift.

Transformation
Turf.js

turf.triangleGrid

Tiles a bounding box with triangular polygons, producing a FeatureCollection for use in binning, interpolation, and visualisations.

Grids
Turf.js

turf.truncate

Truncates coordinate precision in a GeoJSON feature to a given number of decimal places, reducing payload size without changing shape visibly.

Coordinate Mutation
Turf.js

turf.union

Returns the union of two or more GeoJSON polygons, merging overlapping or adjacent shapes with polygon-clipping.

Transformation
Turf.js

turf.unkinkPolygon

Splits a self-intersecting Polygon into multiple valid Polygons, resolving kinks into a clean FeatureCollection.

Misc
Turf.js

turf.voronoi

Generates Voronoi polygons for a set of input points, clipped to a bounding box, using d3-voronoi internally.

Transformation
PostGIS

UpdateGeometrySRID

Updates the SRID metadata of a geometry column and all rows it contains.

Spatial Reference System