geojson-elevation-gain
v0.6.0
Published
compute the elevation gain of a geojson
Readme
Geojson Elevation Gain
Calculate the elevation gain of a Linestring or a Feature
geosjon. Geojson points need to contain elevation like
[-3.51732,47.760888,19.8]. A Simple Moving
Average is
applied on the data before the calculation.
Computing elevation gain is a non trivial thing. The aim of the library is to find an acceptable compromise for most usecases.
Install
npm install --save geojson-elevation-gainor
yarn add geojson-elevation-gainUsage
To calculate the elevation gain in meter of geojson:
getElevationGain(geojson, nbOfPoints)geojsonis the geojson you want to process, could be a Linestring or a feature with a LineString as geometry.nbOfPointsis the width of the SMA.
Development
yarn installRoadmap
- [x] Make it works
- [ ] Make it right
- [ ] Better data handling (Bad/No elevation detection)
- [ ] Multiple algorithms
Tests
Tests are performed across a bunch of reference files coming from la-trace.com. Difference between the result of the algorithm and the reference value should be lower than 10% to be considered as correct.
yarn run build
yarn run test