4

The Google Maps Elevation API lets me pass a URL like

https://maps.googleapis.com/maps/api/elevation/json?locations=39.7391536,-104.984703

along with a developer key, and get a result like

{
   "results" : [
      {
         "elevation" : 1608.637939453125,
         "location" : {
            "lat" : 39.73915360,
            "lng" : -104.98470340
         },
         "resolution" : 4.771975994110107
      }
   ],
   "status" : "OK"
}

My company want to use something like this, but don't have the time for their legal department to go through the license.

Is there something similar with an MIT, Apache, GPL2, or similar license?

Basically, we want to input lat/long and get back elevation.

  • 1
    Does openstreetmap.org do this? If not, you can download DEM files from usgs.gov but that would require setting up your own db/queries. – user1462 Sep 27 '16 at 15:06
  • I am new to this, Do you have a URL for those DEMs? – Mawg says reinstate Monica Sep 27 '16 at 16:14
  • 1
    Start with usgs.gov/products/maps/gis-data but poke around. I know I've found the data I wanted previously, but that was ages ago and they've redesigned the site. Feel free to contact me directly if you'd like. – user1462 Sep 27 '16 at 16:33
  • Alas, I could only find data for the USA :-( – Mawg says reinstate Monica Sep 27 '16 at 16:38
  • 1
    earthexplorer.usgs.gov but I agree they do a good job of hiding it. Googling "world dem maps site:.gov" (no quotes) provides other helpful resources. Not sure who downvoted it, but I upvoted to counteract. Is there a "where to find data?" wiki entry somewhere? – user1462 Oct 7 '16 at 15:13
2

There is the Open-Elevation API (https://open-elevation.com/) that looks promising

see https://github.com/Jorl17/open-elevation/blob/master/docs/api.md for API examples

Live API sample: https://api.open-elevation.com/api/v1/lookup?locations=41.161758,-8.583933

| improve this answer | |
  • Looks great! I notice, though, that it doesn't tell you what area it covers. Do you know? E.g USA only/whole planet? – Mawg says reinstate Monica Jun 10 '19 at 11:52
  • Aha! From the documentation about hosting your own ... "Open-Elevation doesn't come with any data of its own, but it offers a set of scripts to get the whole SRTM 250m dataset" – Mawg says reinstate Monica Jun 10 '19 at 11:54
  • 1
    actually they seem to have performance issues with their hosted API (see comments at github.com/Jorl17/open-elevation/issues/11 and a fiddle to try it out there via Javascript/AJAX), however you could host it on your own private server (probably combined with CORS so that other pages on non-modified web browsers don't hit it) – George Birbilis Jun 10 '19 at 14:48
  • 1
    so I'm currently trying elevation-api.io and it looks quite fast – George Birbilis Jun 10 '19 at 14:49
  • 1
    btw, can also try the CURL sample of Open-Elevation API online at onlinecurl.com – George Birbilis Jun 10 '19 at 15:08
4

I've been working on opentopodata.org as a free, open alternative to the Google Maps Elevation API.

Request URLs look like this:

https://api.opentopodata.org/v1/eudem25m?locations=51.875127,-3.341298

and the response is similar to Google Maps:

{
  "results": [
    {
      "elevation": 502.43035888671875, 
      "location": {
        "lat": 51.875127, 
        "lng": -3.341298
      }
    }
  ], 
  "status": "OK"
}

Open Topo Data is MIT licensed. You can host it yourself or use the free public API.

The public API has a number of open DEM datasets loaded, including a 30m global dataset, the 25m EU-DEM dataset for Europe, and the 10m NED dataset for the US.

| improve this answer | |
  • Awesome! Thanks for the detailed documentation for adding new datasets. Having the ability to serve an elevation api from my own application will be such a great additional resource for the GIS work I'm doing. – djangomachine Apr 30 at 2:40
3

For those continuing to search (I was and landed here). There is a free USGS service which is well buried. Link here. Worked for my use case of a couple of dozen points. HT to @barrycarter for the index link.

| improve this answer | |
  • 1
    "The 1/3 arc-second dataset covers nearly all the U.S. states and territories, though Alaska has only partial coverage" ... so ... it doesn't cover most of the world? Perhaps of use to some but alas, not to me :-( – Mawg says reinstate Monica Jun 10 '19 at 11:48
3

You could try https://elevation-api.io

This is an API which returns elevation data, just as Google does, maybe you'll find it as a suitable replacement.

Disclaimer: I am the developer of the site, but also needed an alternative.

| improve this answer | |
  • 1
    A nice api, but alas, no ocean depth data, from what I can tell (all elevations come back at 0m for locations at sea). – OrangeWombat Jan 29 '19 at 2:21
  • 1
    Yes, unfortunately I haven't included ocean depth data yet, but it is on the todo list. :-) – Miles Jan 29 '19 at 6:59
  • 1
    at your site it says "JSON in POST requests should be in the following format: {"points": [(12.3,45.6),(12.4,23.4)]}", but I found out JSON in POST requests should be in the following format: {"points": [[12.3,45.6],[12.4,23.4]]} was needed (else it kept on returning error that instead of a tuple I was passing a float 12.3) – George Birbilis Jun 10 '19 at 14:57
  • 1
    Ah, thanks @GeorgeBirbilis, I'll have that fixed soon! – Miles Jun 10 '19 at 17:37
  • 1
    @Mawg It's still free, albeit only the 5km resolution. I'm not sure how/why anyone could make use of that, but ~6million requests per day are in the free tier. – Miles Jun 11 '19 at 17:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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