New and Improved Elevation Profiles
When I launched the new version of On the Go Map in September, the most common request I received from people was to bring back elevation profiles. Today I’m happy to announce new and improved elevation profiles for On the Go Map!
To turn on elevation profiles, click the mountain icon in the bottom left. Hover your mouse or drag your finger over the profile to show the elevation, distance, and grade at that point.
How it works
To generate a profile, the site samples up to 512 points at equal intervals along your route, then gets the elevation at each point and renders a chart.
The old version of the site asked a Google service for the elevation at each point, but now Google wants $4 per thousand requests. Given the site was averaging 350k requests per month, this is no longer an option. Luckily, a company called Mapzen generated an open source worldwide elevation dataset before they went out of business last year, and Amazon now hosts that data for free to the public.
The data comes in “elevation image tile” format where the color of each pixel in an image encodes the elevation at that point. The data starts at “zoom level 0” which is a single 256px×256px image that covers the entire planet where each pixel encodes the average elevation of a 150km×150km part of the earth. Zoom level 1 breaks that up into 4 256px×256px images, all the way down to zoom level 15 which covers the entire planet with 1 billion 1km×1km images with 5 meter resolution between elevation samples. This data even includes bathymetry so you can find the depth of any point in the ocean.
To get the elevation for 512 points along your route, On The Go Map simply fetches the elevation tiles covering your path and computes the elevation from the color at each point.
This is an efficient way to deliver the data, since those tiles can be cached all the way out to your browser to minimize the delay fetching elevation data. But there are a few drawbacks:
- Total gain/loss becomes approximate with longer routes because the sampled points could be far apart, missing small ups and downs in between
- Routes through tunnels or over bridges will show the elevation of the ground instead of the road
- There may be some inconsistencies, in particular where elevation tiles meet
I eventually want to include elevation in the route itself which would fix these issues and eliminate delays fetching elevation. If this is important to you, please vote and explain your use case at feedback.onthegomap.com to help me prioritize.
What’s Next?
I hope to make a few quick follow ups to improve this feature:
- Click and drag to highlight and see stats for a section of your route
- Render terrain on the map based on the elevation image tiles
- Add mile/km markers to your route to complement the distance scale on the chart
After that, I’ll work on the next most requested features from people on feedback.onthegomap.com: a search box and satellite imagery.
The full feature set will take some time to bring back to all users in a scalable, cost-effective way but there are several pieces that are easy if I just pay for a more expensive solution. If you are interested in a subscription model to get features like more routing options (car/bike) or other map layers (like satellite) sooner, please reach out to me at mike@onthegomap.com.
Shout outs
Thank you to all the beta testers who gave invaluable feedback to help shape the end product. Also huge thanks to everyone formerly at Mapzen who made this great dataset open to the public.
Let me know what you think of the new feature, or if you want to get involved in beta testing future changes. Thanks for using On The Go Map!
— Mike Barry @msb5014