osrm-backend
osrm-backend copied to clipboard
Support different forward/backward ref values on edges
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.
This is very simple and straight forward to implement:
- Add
forward_refandbackward_refhere: https://github.com/Project-OSRM/osrm-backend/blob/master/include/extractor/extraction_way.hpp#L104 Technically we could do this with every string. - Extend this check for
parsed_way.forward_ref != parsed_way.backward_refhttps://github.com/Project-OSRM/osrm-backend/blob/master/src/extractor/extractor_callbacks.cpp#L384
@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 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.
This issue seems to be stale. It will be closed in 30 days if no further activity occurs.
This issue seems to be stale. It will be closed in 30 days if no further activity occurs.
This issue seems to be stale. It will be closed in 30 days if no further activity occurs.