Nokia Maps: retrieve speed limit based on coordinates using REST API

断了今生、忘了曾经 提交于 2019-12-03 08:36:10

You will need to use the getLinkInfo endpoint from the Enterprise Routing API.. The speedLimit element returned is in m/s so multiply by 3.6 for km/h or 2.23 for mph. If the speedLimit element is missing then the national speed limit applies.

http://route.st.nlp.nokia.com/routing/6.2/getlinkinfo.json?waypoint=52.5308,13.3846&app_id=your_app_id&app_code=your_app_code

A working example can be found on the HERE Maps Community Examples on GitHub

UDPATE: For others that see this question now:

The answer above doesn't work anymore (it doesn't return anything) - you need to use API 7.2 now:

http://route.st.nlp.nokia.com/routing/7.2/getlinkinfo.json?waypoint=52.5308,13.3846&app_id=your_app_id&app_code=your_app_code

Maybe that helps someone!

UPDATE

getlinkinfo will depreciated 31.03.2017. You will have to use Platform Data Extension.

HERE Speed Limit via PDE Demo

--------------

UPDATE - 2

I've got an email from HERE:

In December 2016, we informed our customers that we will retire the getlinkinfo (beta) functionality of the HLP Router API 7.2 by March 31, 2017 and that we would like to ask you to migrate to the Platform Data Extension by this date.

Based on the feedback that we received from several customers we decided to extend the time for migration and keep getlinkinfo available until June 30, 2017 and informed our customers accordingly.

UPDATE: Since Nokia maps renamed to HERE maps, its good practice to use their new HERE API.

Check their documentation how to use it with GPS coordinates.

ckHERE

You may use the HERE ReverseGeocoder with parameter "locationattributes=linkInfo" to get the speed and some more usefull information. Example response:

  linkInfo: {
     functionalClass: 5,
     travelDirection: [
        "NE"
     ],
     speedCategory: "SC7",
     speedLimit: [
        {
           value: 30,
           unit: "kph"
        }
     ],
     linkFlags: [
        "Paved"
     ],
     accessFlags: [
        "Automobiles",
        "Motorcycles",
        "Buses",
        "Taxis",
        "Carpools",
        "Pedestrians",
        "Trucks",
        "Deliveries",
        "EmergencyVehicle",
        "ThroughTraffic"
     ]
  }

See the full details at https://developer.here.com/documentation/geocoder/topics/resource-reverse-geocode.html

At the moment this gives you the speed limit from HERE:

https://route.cit.api.here.com/routing/7.2/calculateroute.json?waypoint0=52.5308,13.3846&waypoint1=52.5308,13.3846&legattributes=li&mode=fastest;car&app_code=your_app_code&app_id=your_app_id

To get the speed limit you need to pass the argument legattributes=li. The speedLimit element is still returned in m/s so multiply by 3.6 for km/h or 2.23 for mph as Jason Fox mentioned.

getlinkinfo will depreciated 31.03.2017. You will have to use Platform Data Extension.

I found what you were looking for:

https://route.cit.api.here.com/routing/7.2/getlinkinfo.json?app_id=APP_ID&app_code=APP_CODE&mode=car&waypoint=-37.732895,144.853912&linkattributes=all

Hope this help.

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