如何在这里API获得SpeedLimit [英] How to get SpeedLimit in HERE API

查看:74
本文介绍了如何在这里API获得SpeedLimit的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个Web应用程序,我需要了解特定道路的速度限制. 对API的调用看起来像是这样:

I'm developing a web app where I need to know speed limit of specific road. The call to API looks lie this:

$.get('http://cre.api.here.com/2/calculateroute.json',    
        'waypoint0=41.69758,-87.78397&waypoint1=41.70056,-87.77429&mode=fastest;car;&overlays=OVERLAYEXAMPLE1&storage=readonly&linkAttributes=speedLimit&app_id=XXX&app_code=YYY',
            function(data) {
                console.log(data.response);
            }
        );

即使我明确请求,我收到的响应也不包含"speedLimit".

The response I'm receiving does not contain "speedLimit" even when I'm explicitly requesting.

我在文档中发现: >: //developer.here.com/documentation/geocoder/topics/resource-type-response-geocode.html#resource-type-response-geocode__link-info

注意:所有链接信息属性均受其他许可的约束.我们保留要求在将来的版本中对所有或单个属性进行API级别授权的权利.当前,只有SpeedLimit属性需要授权,如果客户端应用程序无权接收此信息,则该属性不包含在LinkInfo中.

Note: All link info attributes are subject to additional licensing. We reserve the right to require authorization on API level for all or individual attributes with future releases. Currently, only the SpeedLimit attribute requires authorization and the attribute is not included in LinkInfo if the client application is not authorized to receive this information.

客户说该应用程序已获得授权,因此它不会有任何问题..但是无论如何我都没有收到包含速度限制的期望结果集.

Client says the app is authorized, so no issues should be with it.. but anyways I'm not receiving desired result-set which contains speed limit..

我做错了什么?

推荐答案

您必须使用legattributes = li来获取链接的speedLimit属性.

You have to use legattributes=li to get speedLimit attribute of a link.

以下是有关如何获得路段(道路)限速的示例.

Below is an example on how to get speedlimit for links(roads).

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=xxx&app_id=xxxx

这篇关于如何在这里API获得SpeedLimit的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆