# boundingBox

The smallest box holding every position of a geometry, as
`[west, south, east, north]`. Heights are ignored.

This is a function exported by `@mapcairn/core`, checked against version 0.2.0.

## Signature

```ts
import { boundingBox } from "@mapcairn/core";
 
function boundingBox(input: GeometryInput): BoundingBox;
```

## Description

Longitude is treated as a flat axis, as GeoJSON does. A shape that crosses
the antimeridian must be split at 180 degrees, and the box of its pieces
then spans the whole way round (`west` -180, `east` 180) rather than the
short way across. Use `boundingBoxToBounds` for the shape the map port
takes.

## Parameters

- `input` (`GeometryInput`)

## Returns

`BoundingBox`

## Throws

- `GeometryError` of kind `invalid` for a malformed geometry, `empty` when it
   has no positions.

## See also

- [`GeometryInput`](https://docs.mapcairn.com/api/core/GeometryInput.md)
- [`BoundingBox`](https://docs.mapcairn.com/api/core/BoundingBox-typealias.md)

Source: [packages/core/src/geometry/queries.ts:46](https://github.com/MapCairn/mapcairn/blob/main/packages/core/src/geometry/queries.ts#L46)
