Skip to main content

ST_AREA

Introduced or updated: v1.2.555

Returns the area of a GEOMETRY or GEOGRAPHY object. For GEOMETRY inputs, the function uses planar area based on the shoelace formula. For GEOGRAPHY inputs, the function measures geodesic area on an ellipsoidal model of the earth using the method described in Karney (2013).

Syntax

ST_AREA(<geometry_or_geography>)

Arguments

ArgumentsDescription
<geometry_or_geography>The argument must be an expression of type GEOMETRY or GEOGRAPHY.

Return Type

Double.

Examples

GEOMETRY examples

SELECT
ST_AREA(
TO_GEOMETRY('POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))')
) AS area

┌──────┐
│ area │
├──────┤
1.0
└──────┘

GEOGRAPHY examples

SELECT
ST_AREA(
TO_GEOGRAPHY('POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))')
) AS area

╭────────────────────╮
│ area │
├────────────────────┤
12308778361.469452
╰────────────────────╯
Try Databend Cloud for FREE

Multimodal, object-storage-native warehouse for BI, vectors, search, and geo.

Snowflake-compatible SQL with automatic scaling.

Sign up and get $200 in credits.

Try it today