osrm-backend icon indicating copy to clipboard operation
osrm-backend copied to clipboard

Support different forward/backward ref values on edges

Open danpat opened this issue 8 years ago • 6 comments

We're adding support for cardinal directions on route relations for North American road networks.

However, single carriageway (non-divided) roads that belong to routes with cardinal directions require the ability to store different values depending on the direction of travel.

A simple example is this way: http://www.openstreetmap.org/way/490434780

This belongs to CA 74 West in one direction, and CA 74 East in the other. The way itself has a ref of CA 74.

There are more complex examples as well, where roads have completely different refs in each direction (ref:forward/ref:backward).

We should support edges that have different ref values in each direction - this would give us complete support for cardinal direction information in North America.

danpat avatar Oct 11 '17 05:10 danpat

This is very simple and straight forward to implement:

  1. Add forward_ref and backward_ref here: https://github.com/Project-OSRM/osrm-backend/blob/master/include/extractor/extraction_way.hpp#L104 Technically we could do this with every string.
  2. Extend this check for parsed_way.forward_ref != parsed_way.backward_ref https://github.com/Project-OSRM/osrm-backend/blob/master/src/extractor/extractor_callbacks.cpp#L384

TheMarex avatar Oct 12 '17 22:10 TheMarex

@TheMarex Hm, it's not simple as you wrote. Because in that case we should to store ref_forward and ref_backward in StringMap. In this case it's no data to make decision which one to get in https://github.com/Project-OSRM/osrm-backend/blob/master/src/util/name_table.cpp#L59

I don't fully understand how to pass it in that case to GetRefForID in DataFacade

deniskoronchik avatar Oct 16 '17 13:10 deniskoronchik

@deniskoronchik the problem you mention is related to https://github.com/Project-OSRM/osrm-backend/blob/456b198702ebade436203097bd77ebb6bd39f558/src/extractor/extractor_callbacks.cpp#L360-L364. You would need to generate a different name-id for both forward/backward edge if any of the name/pronunciations do not match in forward/backward direction.

The location @TheMarex is referring to would then be https://github.com/Project-OSRM/osrm-backend/blob/456b198702ebade436203097bd77ebb6bd39f558/src/extractor/extractor_callbacks.cpp#L384-L389 which would simply need to also compare the two name_ids.

The remaining work should simply be to change https://github.com/Project-OSRM/osrm-backend/blob/456b198702ebade436203097bd77ebb6bd39f558/src/extractor/extractor_callbacks.cpp#L427 and https://github.com/Project-OSRM/osrm-backend/blob/456b198702ebade436203097bd77ebb6bd39f558/src/extractor/extractor_callbacks.cpp#L394 to refer to the correct name_ids.

MoKob avatar Oct 17 '17 08:10 MoKob

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

github-actions[bot] avatar Jul 08 '24 21:07 github-actions[bot]

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

github-actions[bot] avatar Jan 05 '25 02:01 github-actions[bot]

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

github-actions[bot] avatar Jul 05 '25 02:07 github-actions[bot]