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

Computes an approximate medial axis of a polygonal geometry. The medial axis is a representation of the "centerline" or "skeleton" of the polygon. This function first computes the straight skeleton and then prunes insignificant branches to produce a cleaner result.

The pruning removes small branches that represent minor penetrations into corners. A branch is pruned if its penetration depth is less than 20% of the width of the corner it bisects.

This function may have significant performance limitations when processing polygons with a very large number of vertices. For very large polygons (e.g., 10,000+ vertices), applying vertex reduction or simplification is essential to achieve practical computation times.

## Signatures

```sql theme={"system"}
ST_ApproximateMedialAxis(geom: Geometry)
```

## Parameters

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

## Return type

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

## Examples

```sql theme={"system"}
SELECT ST_ApproximateMedialAxis(
  ST_GeomFromWKT('POLYGON ((45 0, 55 0, 55 40, 70 40, 70 50, 30 50, 30 40, 45 40, 45 0))')
)
```

```
MULTILINESTRING ((50 45, 50 5), (50 45, 35 45), (65 45, 50 45), (35 45, 65 45))
```

<img src="https://mintcdn.com/wherobots/AayJA2u8CknIeTgt/images/sql-functions/ST_ApproximateMedialAxis/ST_ApproximateMedialAxis.svg?fit=max&auto=format&n=AayJA2u8CknIeTgt&q=85&s=1f5ea6a1761b4ebdf0103f296ae2e478" alt="ST_ApproximateMedialAxis" width="400" height="230" data-path="images/sql-functions/ST_ApproximateMedialAxis/ST_ApproximateMedialAxis.svg" />

### L-shape

```sql theme={"system"}
SELECT ST_ApproximateMedialAxis(
  ST_GeomFromWKT('POLYGON ((0 0, 10 0, 10 5, 5 5, 5 10, 0 10, 0 0))')
)
```

```
MULTILINESTRING ((2.5 2.5, 2.5 7.5), (7.5 2.5, 2.5 2.5), (2.5 7.5, 2.5 7.5))
```
