-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Conditional Access Restrictions #621
Conversation
Thanks! The unsupported things are no problem. One thing which I do not understand is 'Allowance of already restricted ways': Do you mean that |
Yes. This is not yet implemented. During the acceptWay method we have to add an allowance check. Currently, this seems like a conceptual issue to me. We are using a accept fast or fail fast strategy in the acceptWay method. Once we returned 0, we cannot return the acceptBit. I didn't want to change that without discussing it. |
In acceptWay we have a section where one such condition could be included IMO: String firstValue = way.getFirstPriorityTag(restrictions);
if (!firstValue.isEmpty())
{
if (restrictedValues.contains(firstValue) /*&& HERE*/) return 0;
if (intendedValues.contains(firstValue)) return acceptBit;
} The foot&bike need simpler handling: if (way.hasTag(restrictions, restrictedValues) /*&& HERE*/) return 0; Later on we can put this all into one method. For now unit tests should be sufficient e.g. for car&bike. |
@karussell I added the allowance in all encoders (motorcycle, foot, bicycle, and car) and wrote tests accordingly. |
Hmmh, not sure as we still would get What about one class (like |
I did some refactoring. I guess it should readable now :). |
Nice - thanks! Just a tiny thing to discuss (sorry for the nit picking): are there shorter and still nice method names? http://stackoverflow.com/questions/2230871/when-is-a-java-method-name-too-long I can't find better ones, just would move the or could we remove the |
You are right. The I try to name methods in a way that no additional documentation is necessary (whenever possible ;)). And I think the |
Nice, that is exactly like it should be :) !
Yes, you are right. Let us keep this but rename to |
Ok I changed permissed to permitted. I think this should be the better naming for this? |
Okay, this should be better :) Also To make it mergable we also need to avoid throwing exception here: In the class ParsedCalendar the methods should use the Java style like In the new files the license header is missing.
What would be needed to implement this? |
Mhm, most ferries I saw I have quite complex opening hours (or 24/7). We are not yet able to parse these opening hours. See this query http://overpass-turbo.eu/s/dvv. So currently no easy solution available. Some ferries are seasonally closed, but these opening hours are setup quite complex. Firs we have to consider the opening_hours tag (Some things change here, so we'd need a OpeningHoursParser). |
Ok, then we postpone this for ferries, of course. Also related to #439
Those with highway tags and also probably of every nodes with barriers |
I made a few minor modifications and while trying this on real OSM data I stumbled over:
|
I think this is a good idea. Also I think this could be doable with some clever transformations. I just found the OpeningHoursParser of OSMAnd. The do not have a good strategy for the
I added the failing tests to show the limitations of the parsing and I wrote them for me while developing to check if everything behaves as expected. I tested against the specification, which is: |
Please not. It is GPL :(
Okay, then will keep rejecting |
If 'Aug 10-Feb' is used then currently all days in February do not lay inside this interval. Is this according to the wiki or do we need to fix this (potentially in a separate issue) |
I've merged this now |
Created a new issue for this #645 |
This PR adds the feature of checking conditional Access Restrictions. Currently only restrictions that last longer than one day are supported. The WayAcceptor currently uses the current day as comparison value.
Currently the following date formats are supported:
Things that are not supported yet:
(Allowance of already restricted ways, like
yes @ (Su)
is now supported)Partially fixes #374