> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wherobots.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ST_LengthSpheroid

Return the geodesic perimeter of A using WGS84 spheroid. Unit is meter. Works better for large geometries (country level) compared to `ST_Length` + `ST_Transform`. It is equivalent to PostGIS `ST_Length(geography, use_spheroid=true)` and `ST_LengthSpheroid` function and produces nearly identical results.

Geometry must be in EPSG:4326 (WGS84) projection and must be in ==lon/lat== order. You can use ==ST\_FlipCoordinates== to swap lat and lon.

<Note>
  By default, this function uses lon/lat order since `v1.5.0`. Before, it used lat/lon order.
</Note>

<Warning>
  Since `v1.7.0`, this function only supports LineString, MultiLineString, and GeometryCollections containing linear geometries. Use [ST\_Perimeter](/reference/wherobots-db/geometry-data/measurement/ST_Perimeter) for polygons.
</Warning>

<img src="https://mintcdn.com/wherobots/fqh3gPDE0J25Lra_/images/sql-functions/ST_LengthSpheroid/ST_LengthSpheroid.svg?fit=max&auto=format&n=fqh3gPDE0J25Lra_&q=85&s=3f6d83c65a453d943ff409d2901aa517" alt="ST_LengthSpheroid" width="500" height="300" data-path="images/sql-functions/ST_LengthSpheroid/ST_LengthSpheroid.svg" />

## Signatures

```sql theme={"system"}
ST_LengthSpheroid (A: Geometry)
```

## Parameters

<ParamField body="A" type="Geometry" required>
  The input geometry.
</ParamField>

## Return type

<ResponseField type="Double">
  A numeric value.
</ResponseField>

## Example

```sql theme={"system"}
SELECT ST_LengthSpheroid(ST_GeomFromWKT('LINESTRING (0 0, 2 0)'))
```

```
222638.98158654713
```
