Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tyrasd/geojson-stats
calculate stats of GeoJSON properties
https://github.com/tyrasd/geojson-stats
geojson javascript statistics
Last synced: about 17 hours ago
JSON representation
calculate stats of GeoJSON properties
- Host: GitHub
- URL: https://github.com/tyrasd/geojson-stats
- Owner: tyrasd
- License: mit
- Created: 2014-12-29T20:59:27.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2022-09-25T01:11:07.000Z (over 2 years ago)
- Last Synced: 2024-04-28T16:46:09.119Z (9 months ago)
- Topics: geojson, javascript, statistics
- Language: JavaScript
- Size: 6.84 KB
- Stars: 8
- Watchers: 4
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
geojson-stats
=============Calculate statistics of [GeoJSON](http://geojson.org/) data.
usage
-----### as a **command line tool**:
npm install -g geojson-stats
geojson-stats file.geojson![](https://cloud.githubusercontent.com/assets/1927298/5631886/810c0464-95ca-11e4-85e3-883a129ed44d.png)
### as a **library**:
npm install geojson-stats
var stats = require('geojson-stats');
console.log(stats(geojson));API
---### `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](https://en.wikipedia.org/wiki/International_System_of_Units).