How to detect speeding violations with GPS traces

HERE Route Matching API v8 identifies road segments where a driver exceeded the posted speed limit. The API matches GPS trace points to the road network and returns the speed limit for each matched road link. You can then compare this data against the GPS-recorded speed to flag violations.

For information about supported trace formats, see GPS trace file formats and accuracy requirements.

Send the request

Submit your GPS trace file as the request body of a POST request. Replace PATH_TO_GPS_TRACE_FILE with the path to your file and API_KEY with your HERE API key.

curl -X POST \
  -H "Content-Type: application/json" \
  --data-binary @PATH_TO_GPS_TRACE_FILE \
  'https://routematching.hereapi.com/v8/match/routelinks?'\
'routeMatch=1&'\
'mode=fastest;car;traffic:disabled&'\
'attributes=SPEED_LIMITS_FCn(FROM_REF_SPEED_LIMIT,TO_REF_SPEED_LIMIT),LINK_ATTRIBUTE_FCn(ISO_COUNTRY_CODE)&'\
'apiKey=API_KEY'

The request uses the following key parameters:

  • routeMatch=1: Enables route matching mode. The API treats the request body as a GPS trace and computes the most probable driven path.
  • mode=fastest;car;traffic:disabled: Sets the vehicle type to car and disables real-time traffic.
  • attributes=SPEED_LIMITS_FCn(FROM_REF_SPEED_LIMIT,TO_REF_SPEED_LIMIT),LINK_ATTRIBUTE_FCn(ISO_COUNTRY_CODE): Requests the speed limit in both travel directions for each matched road link, along with the country code. Speed limits can vary by country, so the country code helps you interpret the limit values correctly.

Read the response

For each matched road link, the API returns the speed limits and any applicable warnings. Warnings appear when the matched route includes a detected violation, such as speeding or traveling in a prohibited direction.

An example warning message:

Entering link 55527933 at 41.9004,12.46567 into forbidden driving direction

Try it

Explore this use case without writing code. See the interactive demo at https://demo.support.here.com/examples/v3/rme_basic.

📘

Note

You need a HERE platform account to access the demo.

  1. Open the demo link.
  2. Upload a trace file in CSV, GPX, or NMEA format, or click directly on the map to add GPS points manually. You can also choose one of the four supplied examples.
  3. The API matches your trace to the road network and overlays text boxes on road segments where it detected a speed violation or driving anomaly.

Did this page help you?