Name

ST_Perimeter — Returns the length measurement of the boundary of a Polygon or a MultiPolygon.

Synopsis

double ST_Perimeter(bytea LineString);

Alias

Perimeter, ST_Length, Length, ST_Length2D, Length2D,

Description

Returns the length measurement of the boundary of a Polygon or a MultiPolygon. Distance units are those of the geometry spatial reference system.

SQL-MM defines this function for Polygons and MultiPolygons. But in Jaspa returns the 2d length of any Geometry. Linear geometries return their length. Areal geometries return their perimeter.

[Note]

GeometryCollections are supported

Coordinate Dimensions
2D3DM
Spatial Standards Support
OGC SFS for SQL. 1.1 (1999)OGC SFS for SQL. 1.1.0 (2005)OGC SFS for SQL. 1.2.0 (2006)SQL-MM Part 3
---8.1.3 , 9.5.4

Examples

SELECT ST_Perimeter(ST_GeomFromText('LINESTRING (0 0, 10 10, 10 5, 15 10)'));
--Result
26.2132034355964

SELECT ST_Perimeter(ST_GeomFromText('POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))'));
--Result
40

SELECT ST_Perimeter(ST_GeomFromText('
  GEOMETRYCOLLECTION(LINESTRING (0 0, 10 10, 10 5, 15 10),POLYGON((0 0, 0 10, 10 10, 10 0, 0 0)))'));
--Result
66.21320343559643

Related functions

ST_Length