npm install turf-polygon
turf polygon module
Takes an array of LinearRings and optionally an Object with properties and returns a GeoJSON Polygon feature.
| parameter | type | description |
| ------------ | ---------------------- | ------------------------------- |
| rings | Array.
| properties | Object | - an optional properties object |
``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
`
Requires nodejs.
`sh`
$ npm install turf-polygon
`sh``
$ npm test