Skip to content

dmamills/parse-gpx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

parse gpx

codecov.io Build Status

Parses gpx into json for data processing, for..................reasons.

usage

Note: Version 2.0 no longer takes a file as an input. It takes an XML string instead

const fs = require('fs');
const parseGpx = require('parse-gpx');

let gpxContent = fs.readFileSync('./path/to/some.gpx');

parseGpx(file).then(track => {
    console.log(track.totalDistance()); //8824.24 (metres)

    /*
     {
       latitude: string
       longitude: string
       timestamp: string
       elevation: number
       cadence: number
       heartrate: number
       distanceFromPoint: (trackPoint) => number (distance in metres)
     }
    */
    console.log(track.trackPoints[0]);
});

dev

npm test
npm run coverage

license

do wutever u want whenever u want

About

parse gpx files into json

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published