> ## 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_Segmentize

Returns a modified geometry having no segment longer than the given max\_segment\_length.

The length calculation is performed in 2D. When a segment is longer than the specified maximum length, it is split into multiple, equal-length subsegments.

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

## Signatures

```sql theme={"system"}
ST_Segmentize(geom: Geometry, max_segment_length: Double)
```

## Parameters

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

<ParamField body="max_segment_length" type="Double" required>
  The max\_segment\_length value.
</ParamField>

## Return type

<ResponseField type="Geometry">
  The resulting geometry.
</ResponseField>

## Examples

Long segments are split evenly into subsegments no longer than the specified length. Shorter segments are not modified.

```sql theme={"system"}
SELECT ST_AsText(ST_Segmentize(ST_GeomFromText('MULTILINESTRING((0 0, 0 1, 0 9),(1 10, 1 18))'), 5));
```

```
MULTILINESTRING((0 0,0 1,0 5,0 9),(1 10,1 14,1 18))
```

```sql theme={"system"}
SELECT ST_AsText(ST_Segmentize(ST_GeomFromText('POLYGON((0 0, 0 8, 30 0, 0 0))'), 10));
```

```
POLYGON((0 0,0 8,7.5 6,15 4,22.5 2,30 0,20 0,10 0,0 0))
```
