Getting altitude from latitude and longitude (HERE-API)

折月煮酒 提交于 2019-12-25 13:25:12

问题


Is there anyway with the HERE Javascript API to obtain an altitude given a specific latitude/longitude pair? The geo point returned by map.screenToGeo() only returns latitude and longitude as far as I can tell.


回答1:


You can't do it with the HERE API, that I can see, but you can get that information from the Google Elevation API.

By making a GET call and passing in the latitude and longitude in the query, you can get back the altitude from sea level in meters:

https://maps.googleapis.com/maps/api/elevation/json?locations=40.714728,-73.998672

This will return a json object like this:

{
   "results" : [
      {
         "elevation" : 8.883694648742676,
         "location" : {
            "lat" : 40.714728,
            "lng" : -73.998672
         },
         "resolution" : 76.35161590576172
      }
   ],
   "status" : "OK"
}

More info: https://developers.google.com/maps/documentation/elevation/intro




回答2:


There is a plenty different APIs in Internet. The most popular is google on that was mentioned above. Here is the another one here: https://algorithmia.com/algorithms/Gaploid/Elevation

var input = {
    "lat": "50.2111",
    "lon": "18.1233"
};
Algorithmia.client("YOUR_API_KEY")
           .algo("algo://Gaploid/Elevation/0.3.0")
           .pipe(input)
           .then(function(output) {
             console.log(output);
           });



回答3:


No, I don't see how this is possible since latitude and longitude are just x and y coordinates and in no way convey any type of information as to the altitude.



来源:https://stackoverflow.com/questions/31839199/getting-altitude-from-latitude-and-longitude-here-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!