从经纬度获取海拔高度(HERE-API) [英] Getting altitude from latitude and longitude (HERE-API)
问题描述
在给定特定纬度/经度对的情况下,HERE Javascript API是否可以获取海拔高度?据我所知,map.screenToGeo()返回的地理位置仅返回纬度和经度.
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.
推荐答案
您无法使用HERE API做到这一点,但我可以从Google Elevation API获取该信息.
You can't do it with the HERE API, that I can see, but you can get that information from the Google Elevation API.
通过拨打GET并在查询中传递纬度和经度,您可以获取以米为单位的海平面高度:
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
这将返回一个像这样的json对象:
This will return a json object like this:
{
"results" : [
{
"elevation" : 8.883694648742676,
"location" : {
"lat" : 40.714728,
"lng" : -73.998672
},
"resolution" : 76.35161590576172
}
],
"status" : "OK"
}
更多信息: https://developers.google.com/maps/documentation/elevation /intro
这篇关于从经纬度获取海拔高度(HERE-API)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!