node package manager
Don’t reinvent the wheel. Reuse code within your team. Create a free org »



Calculate statistics of GeoJSON data.


as a command line tool:

npm install -g geojson-stats
geojson-stats file.geojson

as a library:

npm install geojson-stats

var stats = require('geojson-stats');


function( geojson, properties )

  • geojson: GeoJSON data. Can be a FeatureCollection, Feature or Geometry object.
  • properties: optional. An array of property names for which stats should be gathered (in addition to line lengths and polygon areas).

The result is an array of objects containing the stats for each requested variable.

Lengths and areas are approximate calculations and given in SI units.