ST_PERIMETER()

All functions > GEOSPATIAL > ST_PERIMETER()

Returns the perimeter of an areal geometry or geography.

Signatures

Perimeter

Returns: Perimeter of the input

ST_PERIMETER(geo: T) → DOUBLE
sql
ParameterTypeRequiredDescription
geoTYesGeometry or geography value

With:

  • T : Custom types: GEOM_POINT | GEOM_LINESTRING | GEOM_POLYGON | GEOM_MULTIPOINT | GEOM_MULTILINESTRING | GEOM_MULTIPOLYGON | GEOM_MULTIANY | GEOG_POINT | GEOG_LINESTRING | GEOG_POLYGON | GEOG_MULTIPOINT | GEOG_MULTILINESTRING | GEOG_MULTIPOLYGON | GEOG_MULTIANY

Signature notes:

  • On GEOMETRY: returns planar perimeter in SRID coordinate units
  • On GEOGRAPHY: returns geodesic perimeter in meters
  • Returns 0.0 for non areal sub kinds (Point, LineString)
  • Not supported on Trino
  • Returns NULL if the input is NULL

Examples

FeatureQL
SELECT
    f1 := ST_PERIMETER(ST_GEOMFROMTEXT('POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0))')) -- Perimeter of a 10x10 square
;
Result
f1 VARCHAR
40.0

Last update at: 2026/05/26 17:22:09