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?

  • The map shows a flat view, seen from the top, so how will elevation change the line?
    – flup
    May 17, 2013 at 23:38
  • mortimermaps.appspot.com/wtp3/wtp3.htm 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, 2013 at 19:20
  • Then use: harrywood.co.uk/maps/examples/leaflet/kml.view.html as an excellent start for KML in leaflet
    – Mapperz
    May 19, 2013 at 19:21
  • 1
    @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, 2013 at 21:26

1 Answer 1


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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