geo-calc-line-references

1.0.1 • Public • Published

Elevation Gain in GPX files

Calculates the distance traveled (linear reference) along a LINESTRING Z geometry, supplied in WKT format. Returns a LINESTRING ZM 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)

Keywords

none

Install

npm i geo-calc-line-references

DownloadsWeekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

106 kB

Total Files

5

Last publish

Collaborators

  • tdcdodger