https://github.com/osmlab/osm-gpx
Simple OpenStreetMap GPX API Interface
https://github.com/osmlab/osm-gpx
Last synced: about 1 year ago
JSON representation
Simple OpenStreetMap GPX API Interface
- Host: GitHub
- URL: https://github.com/osmlab/osm-gpx
- Owner: osmlab
- License: unlicense
- Created: 2013-03-15T16:42:56.000Z (over 13 years ago)
- Default Branch: gh-pages
- Last Pushed: 2013-03-26T19:55:49.000Z (over 13 years ago)
- Last Synced: 2025-06-07T20:09:33.144Z (about 1 year ago)
- Language: JavaScript
- Homepage: http://osmlab.github.io/osm-gpx/examples/leaflet.html
- Size: 106 KB
- Stars: 9
- Watchers: 9
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Retrieve [GPX](http://www.gpx.com/) data from the [OpenStreetMap GPX API](http://wiki.openstreetmap.org/wiki/API_v0.6).
### usage
With browserify:
npm install --save osm-gpx
```js
var osmGpx = require('osm-gpx');
```
Without:
Copy `gpx.js`, include it. `osmGpx` will be attached to `window`.
### api
`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.
```js
osmGpx(bbox, function(err, gpx, geojson) {
// GPX is the GPX XML Document
// GeoJSON is a GeoJSON version of it.
});
```