Skip to content

Maciek416/gpx-stream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gpx-stream

NPM

Stream tracked points (<trkpt/> nodes) from a GPX 1.1 input string.

Usage

var gpx = require('gpx-stream');
var points = new gpx();
var source = fs.createReadStream('./oregon.gpx');

source.pipe(points);

points.on('readable', function(){
  var point;

  while(point = points.read()){
    console.log([
      'Lat:', point.lat,
      'Lon:', point.lon,
      'elevation:', point.elevation,
      '@time', point.time
    ].join(' '));
  }
});

points.on('end', function(){
  console.log('finished');
});

About

Generate an array of tracked points from a GPX string

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published