ST_Area — Returns the area of a Polygon or a MultiPolygon.
double ST_Area(
bytea
Geometry)
;
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.
This function supports GeometryCollection, it will add the area of all polygons. |
2D | 3D | M |
---|---|---|
- | - |
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.1 | 7.2.14.1 | 7.2.12.2 | 8.1.2 - 9.5.3 |
--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