geo-calc-line-references

1.1.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i geo-calc-line-references

Weekly Downloads

0

Version

1.1.0

License

ISC

Unpacked Size

899 kB

Total Files

11

Last publish

Collaborators

  • tdcdodger