This topic describes the ST_Area function. This function calculates the area of a polygon object.
Syntax
float ST_Area(geometry g1);
float ST_Area(geography geog , boolean useSpheroid);
Parameters
Parameter | Description |
---|---|
g1 | The geometry object that you want to specify. |
geog | The geography object that you want to specify. |
useSpheroid | Specifies whether to use an ellipsoid. Default value: True. |
Description
- If you specify a geometry object, this function returns the 2D Cartesian area of the geometry object in the unit that is specified by the spatial reference system of the geometry object.
- If you specify a geography object, this function returns the area of the geometry
object on the ellipsoid that you define. The area is measured in square meters.
You can choose not to use an ellipsoid. This way, this function can calculate the area at a higher speed but with a lower accuracy.
- This function supports polyhedral surfaces.
This function supports 2D polyhedral surfaces. This function does not support 2.5D polyhedral surfaces. If you specify a 2.5D polyhedral surface that completely resides on a plane with only x and y coordinates, this function may return a non-zero result.
Examples
SELECT ST_Area(ST_Buffer(ST_GeomFromText('POINT(0 0)',3857),1000));
st_area
------------------
3121445.15225805
(1 row)