Name

ST_Area — Returns the area of a Polygon or a MultiPolygon.

Synopsis

double ST_Area(bytea Geometry);

Alias

Area

Description

Returns the area of a Polygon or a MultiPolygon. Area units are taken from the spatial reference system of this geometry. The area is calculated in 2D.

[Note]

This function supports GeometryCollection, it will add the area of all polygons.

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
2.1.9.17.2.14.17.2.12.28.1.2 - 9.5.3

Examples

--2D Polygon
SELECT ST_Area(ST_GeomFromText('MULTIPOLYGON (((0 0, 0 10, 10 10, 10 0, 0 0),(2 2, 2 4, 4 4, 4 2, 2 2)))',-1));
--Result:
96.0

--3D Polygon
SELECT ST_Area(ST_GeomFromEWKT('SRID=-1;MULTIPOLYGON (((0 0 5, 0 10 8, 10 10 9, 10 0 2, 0 0 5),(2 2 1, 2 4 1, 4 4 1, 4 2 1, 2 2 1)))'));
--Result:
96.0

--GEOMETRYCOLLECTION
SELECT ST_Area(ST_GeomFromText('GEOMETRYCOLLECTION(POLYGON((0 0, 0 10, 10 10, 10 0, 0 0)),POLYGON((2 2, 2 4, 4 4, 4 2, 2 2)),POINT(5 5))',-1));
--Result:
104.0

Related functions