Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I understand that elevation can be added as an optional third value in Coordinates (lat, long, elev) in a geojson file, but I can't find a way to actually do that from a gpx file. I've used ogr2ogr to convert gpx to geojson. I've also loaded the gpx file into QGIS and saved as a geojson file, but neither method brings in elevation when I do this to the gpx tracks. It will bring in elevation as a Property if I convert the points, but I need a line. Ultimately, I want to diplay these lines in Leaflet and build elevation profiles for them. Is there any easy way to do this other than parsing out the gpx files and building my own geojson files?

share|improve this question

migrated from May 19 '13 at 18:50

This question came from our site for professional and enthusiast programmers.

The map shows a flat view, seen from the top, so how will elevation change the line? – flup May 17 '13 at 23:38 you can import gps .gpx and export to kml including elevation information. "Where is the path?" (wpt) version 3 is geared up for UK areas and touch screen devices now. – Mapperz May 19 '13 at 19:20
Then use: as an excellent start for KML in leaflet – Mapperz May 19 '13 at 19:21
@flup The map will look the same, but I want to build elevation profiles for the lines to display elsewhere on the page – Jim May 23 '13 at 21:26

You can create or import routes on After that, export them as GPX, load the GPX file in, and save it as GeoJSON. You can add as many GPX files as you want to a single GeoJSON.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.