Table of Contents

Class SpatialArea

Namespace
YndigoBlue.Velocity.Functions
Assembly
YndigoBlue.Velocity.dll

Represents the ST_Area spatial function that calculates the area of a polygon or multi-polygon geometry.

public class SpatialArea : Function, IElement, ICheckItem, IDefaultItem, IFilterItem
Inheritance
SpatialArea
Implements

Remarks

Warning

Spatial functions are not available in the Community Edition of Velocity. They require the Full Edition.

The ST_Area function returns the area of a geometry. For Geometry types (planar), it calculates area in coordinate system units squared. For Geography types (spherical), it calculates area on the earth's surface, optionally in specified units. Returns 0 for non-areal geometries (points, lines). Useful for land area calculations, geographic analysis, and spatial statistics. OGC-compliant.

SpatialArea diagram showing polygon areas

Geometry Mode (planar, returns square coordinate units):

ShapeArea
PY0 (4°×4° square)16.0
PY1 (0.5°×1° rectangle)0.5
PY2 (1°×3° rectangle)3.0
PY3 (triangle)0.25
PY4 (2°×1.5° rectangle)3.0
PT1, PT2 (points)0
LN1 (linestring)0

Geography Mode (spherical, returns square meters by default):

ShapeArea (m² default, km² with UnitOfMeasure)
PY0~157,650,000,000 m² (~157,650 km²)
PY1~4,900,000,000 m² (~4,900 km²)
PY2~36,800,000,000 m² (~36,800 km²)
PY3~3,100,000,000 m² (~3,100 km²)
PY4~36,900,000,000 m² (~36,900 km²)
PT1, PT2, LN10 (non-areal geometries)

Units of Measure: For Geography types, the default unit is square meters. Use the SpatialArea(Column, UnitOfMeasure) constructor with UnitOfMeasure to specify alternative units such as square kilometers, square miles, or hectares.

Constructors

SpatialArea(Geometry)

Initializes a new instance of ST_Area for a geometry literal.

SpatialArea(Column)

Initializes a new instance of ST_Area for a geometry column.

SpatialArea(Column, UnitOfMeasure)

Initializes a new instance of ST_Area for a geography column with a unit of measure.

SpatialArea(Function)

Initializes a new instance of ST_Area for a function result (e.g., from another spatial operation).

SpatialArea(Function, UnitOfMeasure)

Initializes a new instance of ST_Area for a function result with a unit of measure.

SpatialArea(Geography, UnitOfMeasure)

Initializes a new instance of ST_Area for a geography literal with a unit of measure.