Skip to content

turf-junkyard/turf-polygon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 Polygon feature.

Parameters

parameter type description
rings Array.<Array.<Number>> an array of LinearRings
properties Object optional: a 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

Returns Feature.<Polygon>, a Polygon feature

Installation

Requires nodejs.

$ npm install turf-polygon

Tests

$ npm test

About

Creates a geojson polygon Feature based on a coordinate array. Properties can be added optionally.

Resources

License

Stars

Watchers

Forks

Packages

No packages published