在给定经纬度的情况下,如何从此处的地图中检索速度限制?

How to retreive speed limit from here maps given a latitude and longitude?

我想从这里 API 地图获取速度限制,但我找不到方法。我在网站上尝试了几个例子,但唯一有效的是需要路线起点和终点的例子。

我想限速只给一个点(或一个方框)。我必须使用哪个 api?有例子吗?

https://route.cit.api.here.com/routing/7.2/calculateroute.json?jsonAttributes=1&waypoint0=51.31854,9.51183&waypoint1=50.11208,8.68342&departure=2019-01-18T10:33:00&routeattributes=sh,lg&legattributes=li&linkattributes=nl,fc&mode=fastest;car;traffic:enabled&app_code=appcode&app_id=appid

这是一个航路点,但不是我要找的,我只想传递纬度/经度。

谢谢

您可以使用 PDE API(平台数据扩展)

  1. 你必须首先将你的地理坐标(纬度,经度)映射到给定坐标的可导航位置(纬度,经度)和它所在的函数Class(FC1-5)。这就是你可以通过简单的地理编码器请求实现
  2. 您可以根据可导航的经纬度计算 tilexy 值,并将其传递给 PDE API 以查询特定 FC class 上的限速层。

查看涵盖此确切用例的 https://tcs.ext.here.com/examples/v3/link_speed_locator 示例。

下面是一个示例地理编码器请求。这里 prox 参数是你的 lat,long

https://reverse.geocoder.cit.api.here.com/6.2/reversegeocode.json?app_id=xxxx&app_code=yyyy&prox=50.133848, 8.715332,500&mode=retrieveAddresses&maxResults=1&additionaldata=SuppressStreetType,Unnamed&locationattributes=linkInfo

下面是一个示例 pde 请求

https://pde.cit.api.here.com/1/tiles.json?layers=SPEED_LIMITS_VAR_FC1,SPEED_LIMITS_VAR_FC2,SPEED_LIMITS_VAR_FC3,SPEED_LIMITS_VAR_FC4,SPEED_LIMITS_VAR_FC5,ROAD_GEOM_FC1,ROAD_GEOM_FC2,ROAD_GEOM_FC3,ROAD_GEOM_FC4,ROAD_GEOM_FC5&levels=9,10,11,12,13,9,10,11,12,13&tilexy=536,398,1073,797,2147,1594,4294,3188,8588,6377,536,398,1073,797,2147,1594,4294,3188,8588,6377&app_id=xxxx&app_code=yyyy

在开发者网站上阅读更多相关信息 - https://developer.here.com/documentation/platform-data/topics/quick-start-view-map-data.html

希望你觉得这有用!

ReverseGeocoder 很少使用模式 "trackPosition" (mode=trackPosition)。

locationattributes=linkInfo 相结合,您可以检索匹配道路的限速。