Question

Does anyone know of an online service / API that can be used to get the highest terrain elevation between two geographic points?

I am using this to determine if sun is blocked by any terrain from the observers perspective at a specific time of day.

I can easily determine the viewers elevation, and I could use something like googles elevation API to walk the path along the correct bearing using distance intervals to create elevation profiles but this seems fairly costly from a query perspective

Thanks

Was it helpful?

Solution

I do not know of any service or API for this, but...

You could use an improved search algorithm to reduce the number of queries required to determine the highest elevation. A "hill climbing" algorithm (yes, that's what it's literally called), would start at some point along the path, check the slope or points on either side of itself to see which direction is uphill, then move uphill in search of a local maximum. There's further optimizations that can be done to improve your selection of starting point and increase the chances you'll find the absolute maximum instead of just the top of one hill.

Some google searching for "hill climbing" algorithms should turn up some useful stuff.

OTHER TIPS

I know this is old now, but this tool exists! I was searching for exactly this same problem, and found this question, as well as my below answer.

This elevation calculator allows you to plot a straight line path (with multiple points if you like) on Google Maps and creates a graph showing the elevation across that path. You can see on the graph the highest point(s) along the path you drew!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top