Finding speed limit of given waypoints using HERE Location Services
So, you know how Intelligent Speed Assist (ISA) became mandatory for new vehicles in the EU back in July 2022? Well, as of July 2024, it's a must-have for all new vehicles sold or registered there. Basically, ISA helps drivers stick to speed limits across different roads. With HERE ISA Map, HERE provides high-quality and fresh speed limit data with comprehensive coverage across the globe. But, ever wondered how to find the speed limit at a specific spot using HERE Location Services?
HERE Route Matching API
The HERE Route Matching API v8 lets developers match GPS traces to real roads, opening doors for all sorts of driving insights and analytics, including the speed limit. So, let's say you want to know the speed limit at a certain coordinate. You'd enter that location into the API, and voila! It'd return the speed limit for that road segment.
Request Sample
This request contains the parameters: waypoint0
and waypoint1
as the input locations and vehicle's mode
respectively. We also need to specify the attributes=SPEED_LIMITS_FCn(*)
to make sure that the speed limit data is returned.
https://routematching.hereapi.com/v8/match/routelinks?
apikey=<secret>
&waypoint0=42.0272,-87.9623
&waypoint1=42.0294,-87.9652
&mode=fastest;car
&routeMatch=1
&attributes=SPEED_LIMITS_FCn(*)
For this example, we use two waypoints as an input. The more waypoints are used as inputs, the better road segment results in the response. The maximum number of waypoints is limited, however, this limit is not a fixed number but is a result of the limit for the overall processing time. waypoint0 ... waypointN
is comma-separated waypoint latitude, longitude in WGS-84 degree. The coordinates may be directly followed by ;transitRadius;label;heading[;optional specifications]
. For more information check the API Reference.
Response Sample
The response shows the speed limit for the road segment (link) in the given coordinate is 113 km/hr or about 70 miles/hr.
{
"response": {
"route": [
{
"mode": {
"type": "matched",
"transportModes": [
"car"
],
"trafficMode": "disabled"
},
"waypoint": [
{
"linkId": "+1249795637",
...
"attributes": {
"SPEED_LIMITS_FCN": [
{
"FROM_REF_SPEED_LIMIT": "113",
"TO_REF_SPEED_LIMIT": "0",
"SPEED_LIMIT_SOURCE": "2",
"SPEED_LIMIT_UNIT": "M"
}
]
},
...
}
],
...
}
],
...
}
}
HERE Map Attributes API
The speed limit data is retrieved from HERE Map Attribute API when attributes=...
parameter is included in the request. Apart from speed limit data from SPEED_LIMITS_FCn(*)
layer, there are additional layers that can be requested within the Route Matching API request (see below). To explore further details, refer to the Map attributes along the route documentation.
ADAS_ATTRIB_FCn | Curvature, height, slope, inside-builtup |
BASIC_HEIGHT_FCn | Link height |
DISTANCE_MARKERS_FCn | Distance marker info, location |
LANE_FCn | Lane-level guidance link connectivity info |
LINK_FCn | Link connectivity info for routing, guidance |
LINK_ATTRIBUTE_FCn | Basic link info for routing, map display |
LINK_ATTRIBUTE2_FCn | Advanced link info for routing, map display |
LINK_TMC_FCn | LINK TMC for live traffic processing |
ROAD_ADMIN_FCn | Road link's administrative hierarchy, postal code |
ROAD_GEOM_FCn | Road link info, geometry for map display |
ROAD_NAME_FCn | Road link name |
ROAD_ROUGHNESS_FCn | Classification of the road surface roughness for driver warning |
ROUNDABOUT_FCn | Roundabout info |
SPEED_LIMITS_FCn | Car speed limit info |
SPEED_LIMITS_COND_FCn | Conditional speed limit info |
SPEED_LIMITS_VAR_FCn | Variable speed sign info |
TOLL_BOOTH_FCn | Toll booth info for toll calculation/optimization |
TOLL_LINK_FCn | Road link toll info for toll calculation/optimization |
TRAFFIC_PATTERN_FCn | Typical link speed per time of day and weekday |
TRAFFIC_SIGN_FCn | Traffic sign info for driver alerts |
TRUCK_SPEED_LIMITS_FCn | Truck speed limit info |
TRUCK_RESTR_FCn | Truck restriction info for routing |
TURN_RESTR_FCn | Turn restriction info |
Closing Thought
The HERE Route Matching API isn't just about matching GPS traces to road links; it also offers all the map context necessary for safety analytics, risk assessment, cost estimations, and more. Should you have any queries along the way, feel free to join us in our Slack workspace!
Resources
- HERE ISA Map
- HERE Route Matching API
- HERE Route Matching API Reference
- HERE Route Matching API - Map Attributes Along The Route
- HERE Map Attributes API - Layers
Have your say
Sign up for our newsletter
Why sign up:
- Latest offers and discounts
- Tailored content delivered weekly
- Exclusive events
- One click to unsubscribe