The ST_Area() function
The ST_Area() function returns the area of a polygon or multipolygon.
Syntax
ST_Area(pl1 ST_Polygon)
ST_Area(pl1 ST_Polygon, linear_uom varchar(128))
ST_Area(mpl1 ST_MultiPolygon)
ST_Area(mpl1 ST_MultiPolygon, linear_uom varchar(128))
ST_Area(pl1 ST_Polygon)
ST_Area(mpl1 ST_MultiPolygon)
The linear_uom parameter converts the result to the specified unit of measure. To calculate the area if the polygon is in a geographic coordinate system where the coordinates are in an angular unit of measure, you must specify a linear unit of measure with the linear_uom parameter. Angular units of measure are converted to linear units of measure by great-circle calculations. If the polygon is in a projected coordinate system that has a unit of measure that is different from the unit of measure that is specified by the linear_uom parameter, then the returned value is converted to the unit of measure that is specified by the linear_uom parameter. The linear_uom parameter must be the name of a linear unit of measure from the unit_name column of the st_units_of_measure table.
Return type
DOUBLE PRECISION
Example: Find the area of buildings
The city engineer needs a list of building areas. To create the list, a GIS technician selects the building ID and area of each building footprint.
CREATE TABLE buildingfootprints (building_id integer,
lot_id integer,
footprint ST_MultiPolygon);
SELECT building_id, ST_Area(footprint) area
FROM buildingfootprints;
building_id area
506 78.00000000000
543 68.00000000000
1208 123.0000000000
178 87.00000000000
Examples: Find the areas of polygons
The following statement returns the area of a polygon in square meters:
EXECUTE FUNCTION round(
st_area(
'32608 polygon((576100 15230, 576100 15232, 576102 15232,
576102 15230, 576100 15230))'::st_polygon,
'meter'),
2);
(expression)
4.00000000000000
1 row(s) retrieved.
The following statement returns the area of a multipolygon in square meters:
EXECUTE FUNCTION round(
st_area(
'32608 multipolygon(((576100 15230, 576100 15232, 576102 15232,
576102 15230, 576100 15230)),((576104 4, 576104 6, 576106 6,
576106 4, 576104 4)))'::st_multipolygon,
'meter'),
2);
(expression)
8.00000000000000
1 row(s) retrieved.
Example: Find the area of a polygon that has angular coordinates
The following statement returns the area in square meters of a 10 kilometer buffer around the coordinates from the angular coordinate system WGS 84 - 4326 that represent the latitude and longitude of New York (40.67000 N, 73.94000 W):
EXECUTE FUNCTION ST_Area(ST_Buffer('4326 point(-73.94000 40.67000)'
::st_point, 10, 'kilometer')::st_polygon, 'meter');
(expression)
313934956.2857