3.0.12 • Published 8 years ago

turf-area v3.0.12

Weekly downloads
11,733
License
ISC
Repository
github
Last release
8 years ago

turf-area

build status

calculate the area of a polygon or multipolygon feature

turf.area(input)

Given any kind of GeoJSON feature, return the area of that feature, in square meters.

Parameters

parametertypedescription
inputGeoJSON

Example

var polygons = turf.featurecollection([
  turf.polygon([[[0,0],[10,0],[10,10],[0,10],[0,0]]]),
  turf.polygon([[[10,0],[20,10],[20,20], [20,0]]])]);
var area = turf.area(polygons);
//=area

Installation

Requires nodejs.

$ npm install turf-area

Tests

$ npm test