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

Returns a linestring spanning minimum and maximum values of each dimension of the given geometry's coordinates as its start and end point respectively.
If an empty geometry is provided, the returned LineString is also empty.
If a single vertex (POINT) is provided, the returned LineString has both the start and end points same as the points coordinates

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

## Signatures

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

## Parameters

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

## Return type

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

## Example

```sql theme={"system"}
SELECT ST_BoundingDiagonal(ST_GeomFromWKT(geom))
```

**Input:** `POLYGON ((1 1 1, 3 3 3, 0 1 4, 4 4 0, 1 1 1))`

```
LINESTRING Z(0 1 1, 4 4 4)
```

**Input:** `POINT (10 10)`

```
LINESTRING (10 10, 10 10)
```

**Input:** `GEOMETRYCOLLECTION(POLYGON ((5 5 5, -1 2 3, -1 -1 0, 5 5 5)), POINT (10 3 3))`

```
LINESTRING Z(-1 -1 0, 10 5 5)
```
