I am sure it's possible to retrieve speed limit on the road based on coordinates. I just can't find any example (rest API). As I understand I need to use routing mechanism to do that?
问题:
回答1:
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
回答2:
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!
回答3:
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.
回答4:
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.
回答5:
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
回答6:
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.
回答7:
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.