# turf-polygon

> turf polygon module

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

## Install

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

## 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.3 |
| Published | 2015-02-06 |
| First published | 2014-04-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | morganherlocker |
| Maintainers | morganherlocker, mourner, jvrousseau, jseppi, cspanring, cwmma, lyzidiamond, tmcw |
| Keywords | gis, geojson, turf, polygon |

## Links

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

## 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.3 (latest) — 2015-02-06
- 1.0.2 — 2015-02-02
- 1.0.1 — 2015-01-06
- 1.0.0 — 2014-12-11
- 0.1.1 — 2014-06-02
- 0.1.0 — 2014-04-02

## README

# turf-polygon

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

turf polygon module


### `turf.polygon(rings, properties)`

Takes an array of LinearRings and optionally an Object with properties and returns a GeoJSON Polygon feature.


### Parameters

| parameter    | type                   | description                     |
| ------------ | ---------------------- | ------------------------------- |
| `rings`      | Array.<Array.<Number>> | - an array of LinearRings       |
| `properties` | Object                 | - an optional properties object |


### Example

```js
var polygon = turf.polygon([[
 [-2.275543, 53.464547],
 [-2.275543, 53.489271],
 [-2.215118, 53.489271],
 [-2.215118, 53.464547],
 [-2.275543, 53.464547]
]], { name: 'poly1', population: 400});

//=polygon

//=polygon.properties
```

## Installation

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

```sh
$ npm install turf-polygon
```

## Tests

```sh
$ npm test
```

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