Repository navigation
Allow CountryRules to provide fallback values for toll - #2164
Conversation
karussell
left a comment
There was a problem hiding this comment.
Thanks, see my comments. (note that it also needs to be updated to master)
83ac65b to
bfff0b5
Compare
bfff0b5 to
e20378d
Compare
|
Any idea why the edge weight in the CustomWeightingTest increases? |
|
You introduced |
|
Gotcha. Should i change the unittest here? The OSMTollParser doesn't store this value and only uses it internally. |
|
As this is a different issue, can you remove MISSING from Toll for this PR? And why do you think we should differentiate between NO and MISSING? Is there a use case you had in mind or for consistency reasons? |
|
There's a difference between a way which is explicitly tagged as We could pass This is also consistent with other encoded values which also treat |
Yes. But are there really many streets that are tagged toll=no and if there are what would be the use case to differentiate between those two cases? (no and missing) But again, I think this is a different issue and unnecessarily delays merging this PR. |
Basically As this PR intends to add a fallback logic, we should not override existing mapping information. e.g motorways in country X usually require toll to be paid. Mappers might tag ways with |
|
Thanks, now I understand the problem :) The problem I have is that this would break existing custom models that use toll (they can be in the request too!) and so this needs more care. (I wonder how we should handle such changes in general?) |
|
+1 to differentiate between no and undefined. Some motorways are explicitly tagged with toll=no to show a difference from the default value of that country. For example in Austria there are some parts of the motorways that have explicitly no toll and it would be good if that would not be overwritten by the default being yes. |
Is this really a problem as we do not encode |
|
Yes, this is a problem and the reason why the unit tests failed. |
As far as i understood this, the test doesn't set a value which causes the EV to pick up the default value which is now |
|
Just checked my assumption by declaring So the only problem is the failing unittest itself, which blindly assumes that the default value is |
|
Existing custom models should also be fine as we encode only
|
|
The problem is that the meaning of "priority": {
"if": "toll != NO",
"multiply_by": 0
}the intent is to exclude tolls, but when we introduce MISSING this no longer works and you would need |
|
That would be true if we encounter the value |
|
Ok, I see. So you introduced MISSING only for the purpose of country rules and in the final graph we never have MISSING. This is a bit confusing I think and not consistent with the other encoded values. |
|
I'm open for other solutions but this allows us to avoid null handling in the CountryRules. |
28c915f to
81e861b
Compare
|
@karussell i'm now using |
|
Hm, thanks for the effort here. Unfortunately it is not consistent with the other methods now :) Ok. Let's introduce the MISSING value and do not overwrite it in the parser, so that everything is consistent and we really have MISSING values for missing tags. We must write this change as a breaking one into the changelog. Furthermore we need to fix all examples, tests and docs where we use |
|
IMHO it is better to break things here and issue a warning. On the positive side, the user gains more flexibility as the CustomModels can handle MISSING at runtime. |
81e861b to
609c5e9
Compare
|
@karussell i resolved the changelog conflict |
|
@karussell anything missing? |
This should improve our toll information coverage for Germany and Austria. I'd really like to get this merged before i start to work on #1808 so that all intended features are already upstream.