Skip to content

ST_Area

Returns the area of a geometry or geography.

Usage

double ST_Area(geom: geometry)
double ST_Area(geog: geography)

Arguments

  • geog (geography): Input geography
  • geom (geometry): Input geometry

Description

ST_Area() Returns the area of a polygon or multi-polygon. For geometry, returns the area in the units of the coordinate reference system (squared); for geography, returns the area in square meters, calculated on a spherical Earth model.

Examples

SELECT ST_Area(ST_GeomFromWKT('POLYGON ((0 0, 1 0, 1 1, 0 1, 0 0))'));
┌──────────────────────────────────────────────────────────────────────┐
│ st_area(st_geomfromwkt(Utf8("POLYGON ((0 0, 1 0, 1 1, 0 1, 0 0))"))) │
│                                float64                               │
╞══════════════════════════════════════════════════════════════════════╡
│                                                                  1.0 │
└──────────────────────────────────────────────────────────────────────┘
SELECT ST_Area(ST_GeogFromWKT('POLYGON ((0 0, 1 0, 1 1, 0 1, 0 0))'));
┌──────────────────────────────────────────────────────────────────────┐
│ st_area(st_geogfromwkt(Utf8("POLYGON ((0 0, 1 0, 1 1, 0 1, 0 0))"))) │
│                                float64                               │
╞══════════════════════════════════════════════════════════════════════╡
│                                                   12364036567.076418 │
└──────────────────────────────────────────────────────────────────────┘