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

Improve cleanup of old parking tags #4549

Closed
wants to merge 12 commits into from
Closed

Improve cleanup of old parking tags #4549

wants to merge 12 commits into from

Conversation

tapetis
Copy link
Contributor

@tapetis tapetis commented Oct 24, 2022

Closes #4534.

I have not seen any problems while testing and the new test cases all work as well. However, I am not really sure if the new code covers all possible parking situations and user selections.

@westnordost
Copy link
Member

Very nice, you even added all those new test cases! Will review asap

Comment on lines 94 to 98
if (right == left) {
add(Regex("^parking:lane:.*"))
if (conditionLeft != null && conditionRight == conditionLeft) {
add(Regex("^parking:condition:.*"))
}
Copy link
Member

Choose a reason for hiding this comment

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

Huh? Everything is removed when left and right are the same? And something with conditions?

I don't quite understand this, shouldn't this if-else-block be about checking whether each side changed only?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The else was too much due to my incorrect test case.

I added this code to cover the issue reported in #4534. Previously, the parking:lane:side tags of the already specified side were not removed correctly if the user were to specify the same parking situation on the other side.

To fix the same problem for parking:condition:side, this code cleans up any preexisting parking:condition tags when the new parking situation of both sides is the either no_parking, no_standing, and no_stopping (i.e. one of the parking conditions currently supported by StreetComplete). However, this code line could probably be changed so that really only the previous parking:condition:side tag is removed and no other subtags of the unchanged side.

- allow parsing only position or orientation without defaulting to "incomplete"
- mark each position and orientation as unknown individually, not for the whole side
@westnordost
Copy link
Member

I added more granular parsing to enable implementation of the suggestions made here #4501 (comment)

They write that StreetComplete should also not delete parking tags for the side that is changed if it is merely supplemented to be complete tagging rather than changing anything.

@westnordost
Copy link
Member

I'm currently looking into the code for that and maybe changing something.

@westnordost
Copy link
Member

westnordost commented Oct 25, 2022

Done for now... (there are failing tests - that are not my fault though).

Though... the crazy complex implementation (at least when one regards that all those edge cases need tests) makes me start to wonder if it is really necessary / correct to clear all those subtags if the parking position and orientation changed.

The argument has been that if that changed, likely the street (parking) was redesigned, so anything parking related could have changed. But with this argumentation, we would also need to remove lanes, cycleway etc. as all this is something that could have been changed after a street redesign. So, the argumentation is not the same as for removing smoothness when changing surface, as these two properties are directly connected to each other...
...while whatever signs say when/how long/if paid/etc. you may park somewhere just happens to be in the same parking:* tagging space but are separate properties.

@tapetis
Copy link
Contributor Author

tapetis commented Oct 25, 2022

Should I still try to fix my implementation? Only the test "applying only one side removes properties specified for both sides" fails currently.

What does this test case cover anyway? Is it even possible to delete an already existing side using the app?

@westnordost
Copy link
Member

Is it even possible to delete an already existing side using the app?

No

@westnordost
Copy link
Member

Hum, I spotted some other issue while adding some tests but I forgot what it was. It was probably some edge case to the "do clear the tags if something changed". But anyway, I guess I should revert/redo some of all this to account for #4549 (comment) ... or at least think a bit more about this first.

@tapetis
Copy link
Contributor Author

tapetis commented Oct 25, 2022

With the changes in my last commit, all test cases are currently passed. I'm in the middle of trying to answer the review comment that's still open. However, if the implementation is to be changed completely, I could skip that.

@westnordost
Copy link
Member

Hmm, I thought about it some more and I think it's better to not clear the whole parking:* space but only replace/remove the tags set by that quest. I'll work on this now.

@westnordost
Copy link
Member

But this PR now contains so much stuff for the conditional removal of subtags that I better start fresh and only selectively copy over some things from this PR

@westnordost westnordost mentioned this pull request Oct 25, 2022
@tapetis tapetis deleted the fix-parking-tags branch October 25, 2022 19:14
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

Successfully merging this pull request may close these issues.

Street parking overlay creates duplicated tags
2 participants