Functions / PostGIS / ST_Area
PostGISMeasurement

ST_Area

What is ST_Area?

ST_Area is a PostGIS function that returns the area of a polygon or multipolygon. It is one of the most common measurement functions in PostGIS and is used any time you need to quantify the two-dimensional extent of a feature — a land parcel, a lake, a census tract, or a service zone.

SQL
1ST_Area(geometry g1)float
2ST_Area(geography geog, boolean use_spheroid = true)float

When called on a geometry, the result is expressed in the units of the input spatial reference system — square degrees for EPSG:4326, square metres for most projected CRSs. When called on a geography, the result is always in square metres and is computed on the WGS84 spheroid by default (set use_spheroid = false for the faster but less accurate sphere calculation).

When would you use ST_Area?

Use ST_Area whenever you need a numeric area figure from stored geometry: computing parcel sizes for a property tax roll, aggregating habitat polygons by hectare for an environmental report, or ranking administrative regions by land area in a dashboard. It is also commonly used in density calculations such as population per square kilometre, in GROUP BY queries to sum up impervious surface area by catchment, and as a filter (e.g. WHERE ST_Area(geom) > 10000) to exclude sliver polygons produced by overlays.

A typical query combining ST_Area with a geography cast to produce square-metre values from lat/lon polygons looks like:

SQL
1SELECT name, ST_Area(geom::geography) AS area_m2
2FROM parks
3ORDER BY area_m2 DESC;

FAQs

What units does ST_Area return?

For geometry input, the result is in the squared units of the geometry's SRID — square degrees for EPSG:4326, square metres for UTM or EPSG:3857 (although 3857 areas are distorted by latitude). For geography input, the result is always in square metres on the WGS84 spheroid.

Why does ST_Area on EPSG:4326 give me a strange number?

Because EPSG:4326 is in degrees, ST_Area returns square degrees, which are meaningless on the ground. Either reproject with ST_Transform to a suitable projected CRS, or cast to geography with ST_Area(geom::geography) to get square metres on the spheroid.

Does ST_Area handle holes correctly?

Yes. The area of a polygon with interior rings (holes) is the outer ring area minus the sum of hole areas. This is the OGC-specified behaviour and matches what you would expect for a parcel with an excluded courtyard or a lake with an island.

Is ST_Area fast on large tables?

ST_Area is a per-row computation and does not use spatial indexes. It is fast enough for typical queries, but if you compute it repeatedly on the same polygons it is worth storing the result in a numeric column (optionally maintained by a trigger) to avoid recomputing. For geography, using use_spheroid = false is noticeably faster when approximate areas are acceptable.