traccar-web icon indicating copy to clipboard operation
traccar-web copied to clipboard

Routing

Open jcardus opened this issue 1 year ago • 9 comments

Is your feature request related to a problem? Please describe. Converting https://github.com/traccar/traccar-web/pull/1293 to a feature request

Would be nice to have routing. I see two use cases:

  • Estimate the distance / time taken from any vehicle to a specific point. This could help the user check, for example, in real time, which is the nearest vehicle (in distance or time) to a specific job / service.
  • Compare the actual trip / route of the vehicle with an estimated one. It would help customers check delays, device kms problems, wrong route decisions, etc. We could draw both lines on the map, actual vs estimated.

Describe the solution you'd like As stated by @jinzo, maplibre-gl-directions would be a good starting point.

jcardus avatar Dec 14 '24 16:12 jcardus

I don't think maplibre-gl-directions is a good starting point. I think we should just call an API on backend and support different providers.

tananaev avatar Dec 14 '24 16:12 tananaev

Yes, the api url in the configuration could be the traccar backend.

Right now it supports https://project-osrm.org/ and https://docs.mapbox.com/api/navigation/directions formats. Apparently doesn't support valhalla which I use and it's very good, but I'm sure it will in the future.

jcardus avatar Dec 14 '24 17:12 jcardus

The problem is also that it connects directly to the provider. Ideally it connects to Traccar backend.

tananaev avatar Dec 14 '24 17:12 tananaev

What do you mean? It connects to whatever url you put in the configuration, which like I said, could be the traccar backend.

jcardus avatar Dec 14 '24 17:12 jcardus

Then we would have to implement a very specific API format compatible with the library.

tananaev avatar Dec 14 '24 17:12 tananaev

Two popular open source routing engines are osrm and valhalla. And valhalla has an option to use osrm format, so it looks like a good choice.

jcardus avatar Dec 14 '24 18:12 jcardus

I second this, if it has to be proxied thorough traccar backend, OSRM API is probably the way to go.

jinzo avatar Dec 16 '24 08:12 jinzo

@jcardus Did you find any possible solution to help us? :/

RafailStratiotis avatar Dec 28 '24 11:12 RafailStratiotis

@RafailStratiotis we have to agree on a "path" first.

jcardus avatar Jan 02 '25 20:01 jcardus