1.0.3 • Published 9 years ago

turf-polygon v1.0.3

Weekly downloads
4,835
License
MIT
Repository
github
Last release
9 years ago

turf-polygon

build status

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

parametertypedescription
ringsArray.<Array.>- an array of LinearRings
propertiesObject- an optional properties object

Example

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.

$ npm install turf-polygon

Tests

$ npm test