问题
I have been using the getlinkinfo command to look at speed limits. The values returned by the API appear to be reduced by a factor of 3.6 relative to posted speed limits on roads in my community. For example, here is a request for a road segment of Highway 101 in Fredericton, NB, Canada that has a posted speed Limit of 90 kph:
http://route.st.nlp.nokia.com/routing/6.2/getlinkinfo.xml?app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg&waypoint=45.921339,-66.666753&linkattributes=sc,sl
(Short link - http://goo.gl/EWfKDe)
This request returns a speed limit of "25" and the actual posted speed limit is 90. Can you tell me why the <SpeedLimit> values do not contain the actual posted speed limit? Is it because I am using the "DemoAppId"?
Bernie.
回答1:
The speedLimit
element is always returned in m/s so you'll need to use a conversion factor to obtain to the typical road sign units. Multiply by 3.6 for km/h or 2.23 for mph. If the speedLimit
element is missing then the national speed limit applies.
Why chose m/s you may ask? I reckon this has been done to avoid rounding errors in calculations by consistently using the smallest distance unit (metre) and the smallest time unit (second) across the HERE platform. I assume that the data underlying getlinkinfo
is used when calculating routes.
A working example can be found on the HERE Maps Community Examples on GitHub
来源:https://stackoverflow.com/questions/22821101/here-maps-rest-api-getlinkinfo-returns-incorrect-speed-limit