# turf-extent

> turf extent module

Latest version **1.0.4** (published 2015-02-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install turf-extent
pnpm add turf-extent
yarn add turf-extent
bun add turf-extent
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2015-02-06 |
| First published | 2014-04-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | morganherlocker |
| Maintainers | morganherlocker, tmcw, mourner, jvrousseau, jseppi, cspanring, cwmma, lyzidiamond |
| Keywords | turf, extent, bbox, polygon, featurecollection, geojson |

## Links

- npm: https://www.npmjs.com/package/turf-extent
- Repository: https://github.com/Turfjs/turf-extent
- Issues: https://github.com/Turfjs/turf-extent/issues
- npm.io page: https://npm.io/package/turf-extent

## Dependencies (1)

- [turf-meta](https://npm.io/package/turf-meta.md) ^1.0.2

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.4 (latest) — 2015-02-06
- 1.0.3 — 2015-01-06
- 1.0.2 — 2015-01-06
- 1.0.0 — 2014-12-11
- 0.1.4 — 2014-07-17
- 0.1.3 — 2014-06-16
- 0.1.2 — 2014-06-02
- 0.1.1 — 2014-04-13

## README

# turf-extent

[![build status](https://secure.travis-ci.org/Turfjs/turf-extent.png)](http://travis-ci.org/Turfjs/turf-extent)

turf extent module


### `turf.extent(input)`

Takes any GeoJSON object, calculates the extent of all input features, and returns a bounding box.


### Parameters

| parameter | type    | description              |
| --------- | ------- | ------------------------ |
| `input`   | GeoJSON | any valid GeoJSON Object |


### Example

```js
var input = turf.featurecollection([
 turf.point([114.175329, 22.2524]),
 turf.point([114.170007, 22.267969]),
 turf.point([114.200649, 22.274641]),
 turf.point([114.186744, 22.265745])
]);

var bbox = turf.extent(input);

var bboxPolygon = turf.bboxPolygon(bbox);
bboxPolygon.properties.fill = '#00f';

var result = turf.featurecollection(
 input.features.concat(bboxPolygon));

//=result
```

## Installation

Requires [nodejs](http://nodejs.org/).

```sh
$ npm install turf-extent
```

## Tests

```sh
$ npm test
```

---
_Source: https://npm.io/package/turf-extent · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
