area
PG 7.4+→ double precisionComputes the area of a geometric object (box, circle, or path).
Signature
area ( geometric_type ) → double precisionParameters
| Parameter | Type | Description |
|---|---|---|
| shape | box, circle, or path | Geometric shape |
Examples
SELECT area('((0,0),(1,1))'::box);1SELECT area('<(0,0),1>'::circle);3.141592653589793SELECT area('((0,0),(1,0),(1,1),(0,1))'::path);1 (closed path = polygon)SELECT id, name, area(footprint) AS sq_units FROM buildings ORDER BY area(footprint) DESC LIMIT 10;Top 10 buildings by footprint areaarea() operates in pure Euclidean 2D space with no concept of Earth's curvature or coordinate projections. Storing (longitude, latitude) in a point column and calling area() on a polygon built from those coordinates will produce results in degrees-squared, which is meaningless and varies by latitude.
✓ Instead: Use PostGIS: `ST_Area(ST_Transform(geom, 3857))` for metric area, or `ST_Area(geog)` on a geography column for geodetic area in square metres.
PostgreSQL's built-in geometric types are for 2D Euclidean geometry only — no coordinate projections. For geographic area (square kilometers on Earth's surface), use PostGIS with `ST_Area(ST_Transform(geom, 3857))` or similar.
SELECT area('<(0,0),5>'::circle) AS euclidean_area;78.5398 (πr²)