📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

ST_AREA



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 │ ╰────────────────────╯

Was this page helpful?