1.1.0 • Published 5 months ago

geo-calc-line-references v1.1.0

Weekly downloads
3
License
ISC
Repository
github
Last release
5 months ago

Elevation Gain in GPX files

Calculates the distance traveled (linear reference) along a LINESTRING Z or MULTILINESTRING Z geometry, supplied in WKT format. Returns a WKT geometry with the M dimension populated.

The final result is in the same units as the original source data.. likely meters if sourced from Strava.

Installing with NPM

npm i --save geo-calc-line-references

Example

// load dependencies 
const fs = require('fs')
const gpxCalcLineReferences = require('./gpxCalcLineReferences.js')

// open sample file and load WKT
const sampleWKT = fs.readFileSync('./sample_data/Sample_Stintson_Beach.wkt', 'utf8')

// calculate linear references and save into WKT with 4th "M" dimension
const referencedWKT = gpxCalcLineReferences( sampleWKT )

console.log(referencedWKT)

Dev/Test

nvm use
npm install
npm test
1.1.0

5 months ago

1.0.1

4 years ago

1.0.0

4 years ago

0.1.3

4 years ago