GuidesAPI Reference
Guides

How to detect speeding violations with GPS traces

HERE Route Matching v8 can compute the (most probable) route through a driven GPS trace. It is very similar to a route matching combined with a route calculation, but not every waypoint has to be reached accurately. Instead, the typical GPS inaccuracies are taken into account. For information on input data, see GPS trace file formats and accuracy requirements.

In addition to the GPS points matched onto road links and the most probable route path, the response provides relevant info for risk analytics and driver behavior.

Code

The following is a sample request.

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 response includes a list of specific route links where the driver has been speeding or driving into the wrong direction. This is a sample response: "Entering link 55527933 at 41.9004,12.46567 into forbidden driving direction".

Procedure

You can provide the input data as specified in the sample request from the preceding section. Alternatively, you can provide a trace file directly to the interface. For an interactive presentation of the example, see https://demo.support.here.com/examples/v3/rme_basic.

A list of points and speed limits at those points can be provided and the Route Matching Extension calculates a route through them. The trace data is inserted using a trace file in the formats CSV, GPX, or NMEA. The trace file contains data such as coordinates, elevation, or speed. For more information on input formats, see GPS trace file formats and accuracy requirements.

You can also insert trace data by directly clicking onto points in the map.

Result

A route is shown on the map. Added to the route are text boxes with warnings about, for example, speed limits.

The POST request returns a list of warnings at specific route links. For more information on output formats, see GPS trace file formats and accuracy requirements.