Project-OSRM / osrm-backend

Open Source Routing Machine - C++ backend
http://map.project-osrm.org
BSD 2-Clause "Simplified" License
6.29k stars 3.32k forks source link

Add metadata to edge #6246

Closed AmirRouteFinder3 closed 1 month ago

AmirRouteFinder3 commented 2 years ago

Hello,

I have some questions related to OSRM. My team has the use case to retrieve additional data for an edge (that we compute in a separate workflow not related to OSRM).

So we have a bunch of data like: from to val and we would like to embed this information into the OSRM service and be able to update it.

Is there a common way to do this?

Thank you so much! :D

AmirRouteFinder3 commented 2 years ago

Hi,

Do you have any insights into this? It would really help my team .

Thank you, Amir

danpat commented 2 years ago

@AmirRouteFinder3 OSRM is not really designed for this, so the capabilities are limited. Here are the options that work today:

  1. OSRM does store the OSM node IDs and can return them along the full path. You can create an external database of node pairs with the properties you want. I created https://github.com/mapbox/route-annotator a few years ago to do this, but I haven't been maintaining it. A simple SQL database could serve the same purpose if properly indexed.
  2. You can put your metadata in the name property on edges, perhaps encoded as JSON or something similar. This will mostly work, but OSRM is not specifically designed to return all names - the turn-by-turn guidance logic can collapse some edges so you may not get all names back along the route (e.g. obvious turns are collapsed).
github-actions[bot] commented 2 months ago

This issue seems to be stale. It will be closed in 30 days if no further activity occurs.