Or some info from Google Developers
https://developers.google.com/maps/documentation/roads/snap
I could not post more then two links in the topic above. Btw i read some old topics here about it, but not really found a project.
Hello, I had never heard of it and I haven't used it either, it would be good to look at the documentation as soon as possible
Actually in the past it was already implemented in a fork of traccar support for the new version of the OSRM API (v5) used for the “Snap-to-roads” functionality.
I will deepen my view on this matter. Thanks
Have any colleagues managed to implement OSRM in Traccar and achieve a significant improvement in reporting?
I'm looking forward to your answers on this subject. Since the devices can sometimes be positioned in this way, they also have the ability to load according to angle, but deviations may occur in this way.
I am using a clean installation of Traccar Server v6.8 on Ubuntu. I am trying to use the 'Show Route' feature in the reports to display the route on the road, instead of a straight line between points.
I have enabled the geocoder with geocoder.type = nominatim and I have set <entry key='web.lilius'>true</entry> in my config file.
When I generate a report and enable the 'Show Route' option, I can see the checkbox, but it does not draw the calculated route on the map (the "blue line"). The log files show no errors.
The main documentation for the config file does not list the old routing.* parameters anymore.
What is the official, documented way to configure a routing provider (like GraphHopper or OSRM) to make the 'Show Route' feature work in the latest versions?
Thank you.
The web.lilius does not exist. You should probably check the official documentation first.
I checked the documentation and there is no SnapToRoad functionality, but i read on other Topics that this is somehow achievable
has been tested and can be implemented using one of the following approaches:
You have a working example or links / tutorial for a working setup?
At the moment, I haven’t created any specific documentation yet, and there’s quite a lot involved in the process.
Maybe in the future I’ll try to push it to Git.
My apologies.
As an example, here are the results from the OSRM routing engine backend stored in a database, with a Node.js UI serving as the viewer.
I hope this provides a simple illustration
Produced by route controller function
which is generated by the route controller function based on device data in the database, and processed into an OSRM-backend URL
// GET /api/routes/device/:deviceId
router.get('/device/:deviceId', routeController.getDeviceRoute);
// GET /api/routes/device/:deviceId/time-range
router.get('/device/:deviceId/time-range', routeController.getDeviceTimeRange);
// GET /api/routes/device/:deviceId/match (map matching)
router.post('/device/:deviceId/match', routeController.matchRoute);

Ok, so acctually you only get the positions from traccar server, there's no implementation in traccar server itself right ?
Yes, you're right; that's how it works in the object above.
Using the middleware method could be the safest approach in practice.
Traccar itself hasn't implemented it in its source code yet. I haven't found that yet
So in that case, Traccar functions as a tracking server with various internal processes and provides routing using the Haversine algorithm (fast).
The custom “snap to road” visual (slower) is processed separately via GeoJSON outside the tracking server (Traccar) using the available forwarding feature.
Note: There is a difference in coordinate order usage:
Traccar --> Latitude, Longitude (lat, lon) (GPS/NMEA & Human conventions)
OSRM --> Longitude, Latitude (lon, lat) (GIS/GeoJSON/OSM standards)
Even if implemented / integrated directly into the backend as a custom feature, the OSRM engine would likely remain a separate component outside of the Traccar tracking system itself
OSRM as an independent service system
Possibility of native code implementation, with the following (as an opinion):
src/main/java/org/traccar/
--> reports/RouteReportProvider.java (addition of custom imports & routing logic)
--> api/ReportResource.java (addition of custom imports & routing logic:)
--> routing/OsrmClient.java (new class & constructor)
--> config/Keys.java (addition of routing config key)
e.g. :
/**
* Routing engine type: none, osrm, graphhopper, valhalla
* Default: none (disabled)
*/
public static final ConfigKey<String> ROUTING_TYPE = new StringConfigKey(
“routing.type”,
List.of(KeyType.CONFIG),
“none”);
/**
* Base URL for routing engine API endpoint
* Example: http://localhost:5000
*/
public static final ConfigKey<String> ROUTING_URL = new StringConfigKey(
“routing.url”,
List.of(KeyType.CONFIG),
“http://localhost:5000”);
and so on, in accordance with the OSRM-Engine platform architecture
In short, that’s just as opinion
Has anyone been working on or implemented Snap to Roads in traccar server ?
The idear seems interesting if it can be used for showing a "better" route in traccar.
I found some links, might be interesting to run your own server for it.
https://github.com/Project-OSRM
https://github.com/valhalla/valhalla
Anyone has idears about it or some tutorials if you have used it with traccar server ?