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?
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.
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:
Maybe that helps someone!
UPDATE
getlinkinfo
will depreciated 31.03.2017. You will have to use Platform Data Extension.
--------------
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.
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:
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:
Hope this help.
来源:https://stackoverflow.com/questions/21883255/nokia-maps-retrieve-speed-limit-based-on-coordinates-using-rest-api