Provision for calculating road speed while saving the position data

Rishia month ago

Hi,

I am currently working on a project where I need to calculate speed violations based on the road speed limit. I am using Traccar’s API to get trips and idle data, and I also use the OpenStreetMap (OSM) geocoder to convert coordinates to addresses.

However, I am wondering if there is any built-in provision or method in Traccar to obtain the road speed limit directly from the coordinates (similar to how we use geocoders to get addresses). Alternatively, is there any recommended way to integrate this functionality with Traccar using external data sources or APIs?

Thanks in advance.

Anton Tananaeva month ago

We support Overpass as the speed limit provider.

Rishia month ago

Hi Anton,

Thanks for your response. I see that Traccar supports Overpass as the speed limit provider. However, I would like to clarify whether there is a way to differentiate overspeed events based on the speed limit set on the device versus the speed limit provided by Overpass.

For example, if a device has a custom speed threshold configured, will Traccar indicate whether an overspeed event was triggered due to this custom threshold or the road speed limit fetched from Overpass? Or is there a way to distinguish between the two in the event data?

Looking forward to your insights. Thanks!

Anton Tananaeva month ago

I think we include the speed limit value in the event, so that's one way to distinguish.

Rishi14 days ago
  • Can we create a computed attribute speed > maxSpeed, where speed is the actual speed from the device and maxSpeed is the allowed road speed ?.
Anton Tananaev14 days ago

Probably, but I don't understand the purpose.

Rishi9 days ago

I have configured the following entries in my traccar.xml file to enable speed limit lookup using an Overpass API:

<entry key='speedLimit.enable'>true</entry>
<entry key='speedLimit.type'>overpass</entry>
<entry key='speedLimit.url'>http://servier_ip:12345/api/interpreter</entry>

I would like to kindly ask — does the speed limit value retrieved from Overpass get saved in the tc_positions table (as part of the attributes JSON), or is it used only for generating overspeed events?

Thank you in advance for your guidance!

Anton Tananaev9 days ago

It is saved in the tc_positions table.

Rishi8 days ago

We are using Traccar version 4.10. Will this feature work in this version, or do we need to upgrade to the latest version for the road speed to be saved in the tc_positions table? Are there any additional configurations we need to set apart from the above-mentioned speedLimit settings?

Anton Tananaev8 days ago

It won't work on version 4.10. It's too old.

Rishi6 days ago

Ok, Thank you for the confirmation.