Skip to content

car_road_access instead road_access - #3066

Open
karussell wants to merge 9 commits into
masterfrom
car_road_access
Open

karussell wants to merge 9 commits into
masterfrom
car_road_access

Conversation

@karussell

@karussell karussell commented Oct 15, 2024 •

Copy link
Copy Markdown
Member

Use car_road_access instead road_access everywhere.
Based on #3056.

Note that for consistency the car_road_access must contain MISSING but it should not be added to road_access as the meaning of YES would be changed, which is important for custom_models.

TODO: maybe better get rid of MISSING (like partially done for toll) and set the default access like dismount/yes/no for the different highways (e.g. highway=path/pedestrian/footway is dismount or for motorway it is no etc).

*/
public interface CountryRule {
default RoadAccess getAccess(ReaderWay readerWay, TransportationMode transportationMode, RoadAccess currentRoadAccess) {
default CarRoadAccess getAccess(ReaderWay readerWay, TransportationMode transportationMode, CarRoadAccess currentRoadAccess) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getCarAccess(ReaderWay, CarRoadAccess)

Otherwise we would need to come up with a generic approach for the various RoadAccess enums in order to make use of the passed TransportationMode.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw why do we want to split the RoadAccess enum? I understand that some values only make sense for certain transportation modes but keeping them in a single enum keeps interfaces like this one a lot cleaner.

@karussell karussell Nov 4, 2024 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The most important reason is that currently road_access is car-centric (i.e. renaming it to car_road_access is basically only a clarification) and there is no such solution for bike or foot or other transportation modes. See #2819.

One important immediate result is that with that we can configure the private access via a custom model configuration instead of putting this into the encoded value configuration. See #3076.

(And isn't this the same as you asked for in #2460?)

Otherwise we would need to come up with a generic approach for the various RoadAccess enums in order to make use of the passed TransportationMode.

Yes, I think this is exactly the problem we have atm and the country-rules are just car-based, but this should be changed at a later time as indicated by my "follow up".

Base automatically changed from xy_road_access to master November 7, 2024 10:23

This branch was previously deployed

1 inactive deployment
benchmarks — 39dccca3 Deployed Nov 18, 2024 by karussell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants