node package manager
Easy sharing. Manage teams and permissions with one click. Create a free org »


Retrieve GPX data from the OpenStreetMap GPX API.


With browserify:

npm install --save osm-gpx
var osmGpx = require('osm-gpx');


Copy gpx.js, include it. osmGpx will be attached to window.


osmGpx(bbox, [pages], callback)

  • bbox is a [w, s, e, n] order bounding box of WGS84 coordinates
  • pages is an optional parameter for a limit to how many 5,000 point pages are requested. by default, it's one.
  • callback is called with err, gpx, geojson after all pages are requested.
osmGpx(bbox, function(err, gpx, geojson) {
    // GPX is the GPX XML Document 
    // GeoJSON is a GeoJSON version of it.