Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

turf-area

Turfjs51.6kISCdeprecated3.0.12

Turf packages are now namespaced: please use @turf/area instead

calculate the area of a polygon or multipolygon feature

turf, area, polygon, multipolygon

readme

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

parameter type description
input GeoJSON

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