简体   繁体   English

从经纬度获取高度(HERE-API)

[英]Getting altitude from latitude and longitude (HERE-API)

Is there anyway with the HERE Javascript API to obtain an altitude given a specific latitude/longitude pair? 无论如何,HERE Javascript API在给定特定纬度/经度对的情况下是否可以获得海拔? The geo point returned by map.screenToGeo() only returns latitude and longitude as far as I can tell. 据我所知,map.screenToGeo()返回的地理位置仅返回纬度和经度。

You can't do it with the HERE API, that I can see, but you can get that information from the Google Elevation API. 我可以看到,您无法使用HERE API来做到这一点,但是您可以从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: 通过拨打GET并在查询中传递纬度和经度,您可以从以米为单位的海平面获取高度:

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

This will return a json object like this: 这将返回一个json对象,如下所示:

{
   "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 更多信息: https : //developers.google.com/maps/documentation/elevation/intro

There is a plenty different APIs in Internet. Internet中有很多不同的API。 The most popular is google on that was mentioned above. 上面提到的最受欢迎的是google。 Here is the another one here: https://algorithmia.com/algorithms/Gaploid/Elevation 这是这里的另一个人: 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); }); 

不,我不知道这是怎么可能的,因为纬度和经度只是x和y坐标,而绝不传达任何有关高度的信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM