turf polygon module
Takes an array of LinearRings and optionally an Object with properties and returns a Polygon feature.
| parameter | type | description |
|---|---|---|
rings |
Array.<Array.<Number>> | an array of LinearRings |
properties |
Object | optional: a properties object |
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});
//=polygonReturns Feature.<Polygon>, a Polygon feature
Requires nodejs.
$ npm install turf-polygon$ npm test