Skip to content

ST_Length

Returns the length of a geometry.

Usage

double ST_Length(geom: geometry)

Arguments

  • geom (geometry): Input geometry

Description

Returns the length of geom. This function only supports LineString, MultiLineString, and GeometryCollections containing linear geometries. Use ST_Perimeter for polygons.

Examples

SELECT ST_Length(ST_GeomFromWKT('LINESTRING(0 0, 10 0)'));
┌──────────────────────────────────────────────────────────┐
│ st_length(st_geomfromwkt(Utf8("LINESTRING(0 0, 10 0)"))) │
│                          float64                         │
╞══════════════════════════════════════════════════════════╡
│                                                     10.0 │
└──────────────────────────────────────────────────────────┘