Skip to main content
APIs 4 min read

Finding speed limit of given waypoints using HERE Location Services

finding speed limit

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.

Copied
        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. 

Copied
        {
    "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_FCnCurvature, height, slope, inside-builtup
BASIC_HEIGHT_FCnLink height
DISTANCE_MARKERS_FCnDistance marker info, location
LANE_FCnLane-level guidance link connectivity info
LINK_FCnLink connectivity info for routing, guidance
LINK_ATTRIBUTE_FCnBasic link info for routing, map display
LINK_ATTRIBUTE2_FCnAdvanced link info for routing, map display
LINK_TMC_FCnLINK TMC for live traffic processing
ROAD_ADMIN_FCnRoad link's administrative hierarchy, postal code
ROAD_GEOM_FCnRoad link info, geometry for map display
ROAD_NAME_FCnRoad link name
ROAD_ROUGHNESS_FCnClassification of the road surface roughness for driver warning
ROUNDABOUT_FCnRoundabout info
SPEED_LIMITS_FCnCar speed limit info
SPEED_LIMITS_COND_FCnConditional speed limit info
SPEED_LIMITS_VAR_FCnVariable speed sign info
TOLL_BOOTH_FCnToll booth info for toll calculation/optimization
TOLL_LINK_FCnRoad link toll info for toll calculation/optimization
TRAFFIC_PATTERN_FCnTypical link speed per time of day and weekday
TRAFFIC_SIGN_FCnTraffic sign info for driver alerts
TRUCK_SPEED_LIMITS_FCnTruck speed limit info
TRUCK_RESTR_FCnTruck restriction info for routing
TURN_RESTR_FCnTurn 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

 

Erwin Soekianto

Erwin Soekianto

Developer Evangelist

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