Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hail_and_ride is not recognized as valid role for bus route #19

Open
mfrasca opened this issue Jul 4, 2022 · 1 comment
Open

hail_and_ride is not recognized as valid role for bus route #19

mfrasca opened this issue Jul 4, 2022 · 1 comment

Comments

@mfrasca
Copy link

mfrasca commented Jul 4, 2022

title says it all, I'm using the view public transport - routes to highlight whenever a route in my area becomes broken. unfortunately this works properly only for urban buses, where no section is "hail_and_ride". for rural bus routes, they all fail the role test.

if I understand the logic, we have two types of way members, one set where the roles would identify the way as a platform, one set where the roles would identify the way as a route section. as of now, members of this second set are only allowed the empty role, while I need 'hail_and_ride' to be accepted as well.

in this example area one route now correctly passes all tests, two more routes should pass all tests (now failing the unknown_role test), one route should fail the no_stops_pltf_at_begin test as it indeed does now.

@mfrasca
Copy link
Author

mfrasca commented Jul 4, 2022

I see that role checking for stops and platforms is done by means of two string comparison functions, while role checking for ways is just strcmp against the empty string.

possibly enough to replace the various comparisons !strcmp(x->role(), "") by an invocation is_way(x->role()) of the following function:

bool PTv2Checker::is_way(const char* role) {
    return !strcmp(role, "") || !strcmp(role, "hail_and_ride");
}

possibly like this, but you surely want unit tests …
my.patch.gz

mfrasca added a commit to mfrasca/osmi_pubtrans3 that referenced this issue Jul 7, 2022
mfrasca added a commit to mfrasca/osmi_pubtrans3 that referenced this issue Jul 7, 2022
hail_and_ride, gap detection for oneway roads included in opposite direction.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant