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

ask about barrier on intersection of barrier line and path [ready for review, again] #3515

Merged
merged 45 commits into from
Jan 18, 2022

Conversation

matkoniecz
Copy link
Member

@matkoniecz matkoniecz commented Nov 18, 2021

fixes #3372


What would be the good quest question in this quest?

both

What is where path goes through a barrier?

What type of Stile/Gate/Gap is here?

What is at intersection of path and barrier?

are unfortunate and seem clunky to me.


Below are things that I implemented to my satisfaction (more or less) but I can be easily convinced to change that.

Is it a good idea to keep complex "path must actually cross barrier" logic? It was implemented already and will keep out some rare confusing cases.

Is it fine to duplicate this logic and helper function from crossing quest? If no where would be the best place to put it?

I plan to have both path quest and road quest here. For now just path is implemented, with shared code in a separate class.

(why separate quest for roads? Because it is typical to have gate for road and separately mapped path without a barrier along it, and separate quest logos and titles would be an useful help here)

Copy link
Member

@westnordost westnordost left a comment

Choose a reason for hiding this comment

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

I'd very much prefer if there was no class hierarchy to share code. There are other ways to share code. (See e.g. KerbUtil)

Part or most of the filter logic could certainly go into a common utils file. The function that is called should have a clear general interface though. The primitives could move to SphericalEarthMath if they are primitive/general enough

matkoniecz added a commit to matkoniecz/Zazolc that referenced this pull request Nov 20, 2021
@matkoniecz
Copy link
Member Author

Some new ideas for the question:

What type of stile/gate/gap is here?

How does this path go through this barrier?

What is present where this barrier intersects the path?

sourced from Discord OSM Server

@westnordost
Copy link
Member

Or

"What kind of barrier is here?"

It doesn't really matter for the user where the app sourced the information from that at this point, there is (very probably) some kind of barrier.

@matkoniecz
Copy link
Member Author

matkoniecz commented Nov 22, 2021

It doesn't really matter for the user where the app sourced the information from that at this point, there is (very probably) some kind of barrier.

It is very useful when path and road close to each other have different barriers.

In other words I think that in this case this info can be easily made available and is likely to be useful so I want to make it available.

In related news I tried making icons and run into some issues described at https://graphicdesign.stackexchange.com/questions/154894/why-path-intersection-in-inkscape-is-not-fully-accurate (I hope that someone will reply there)

@matkoniecz
Copy link
Member Author

I suspect that @westnordost is not entirely convinced about splitting this quest - but I would go in opposite direction, merge in here asking about barrier=yes located on paths and roads.

In meantime I tried making icons.

screen02

@matkoniecz matkoniecz reopened this Nov 29, 2021
@matkoniecz matkoniecz marked this pull request as ready for review November 29, 2021 15:40
@westnordost
Copy link
Member

What is the status of this PR, is it ready to review / merge? Any open questions?

@matkoniecz
Copy link
Member Author

matkoniecz commented Dec 16, 2021

It is ready to merge (after solving minor conflict on language files) but

  • not sure are you happy about icons (I am)
  • you were dubious about splitting it into two quests

Why two quests?

It is very useful when path and road close to each other have different barriers.

I think that in this case this info can be easily made available and is likely to be useful so I want to make it available. I even thought about merging in question about barrier=yes into this quest for barrier=yes within highway= lines representing roads and paths.

Copy link
Member

@westnordost westnordost left a comment

Choose a reason for hiding this comment

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

Regarding the picture, how about this
wall

matkoniecz and others added 3 commits January 14, 2022 13:18
…_type/AddBarrierOnRoad.kt

Co-authored-by: Flo Edelmann <florian-edelmann@online.de>
Co-authored-by: Flo Edelmann <florian-edelmann@online.de>
…_type/AddBarrierOnPath.kt

Co-authored-by: Flo Edelmann <florian-edelmann@online.de>
@matkoniecz
Copy link
Member Author

By the way, I like the icons!

Thanks, nice to hear it (especially as it is likely the first real icon that I made on my own and actually liked)

matkoniecz and others added 6 commits January 14, 2022 19:59
Co-authored-by: Flo Edelmann <florian-edelmann@online.de>
Co-authored-by: Flo Edelmann <florian-edelmann@online.de>
Co-authored-by: Flo Edelmann <florian-edelmann@online.de>
Co-authored-by: Flo Edelmann <florian-edelmann@online.de>
Copy link
Member

@FloEdelmann FloEdelmann left a comment

Choose a reason for hiding this comment

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

Co-authored-by: Flo Edelmann <florian-edelmann@online.de>
@matkoniecz
Copy link
Member Author

matkoniecz commented Jan 14, 2022

#3515 (comment) (the bottom part; unfortunately this is too large for a suggested change on GitHub)

Hmm, I do not really find this additional bonus change as a better one.

Too many things happening at all for me.

#3515 (comment)

This should never happen as only nodes without tags are taken.

Though "Error: this should never happen, it is impossible" is not unusual. Not sure.

Even if it crashes, then crash and clear info that things went horribly wrong would be better than silent data corruption.

#3515 (comment)

Done.

@peternewman
Copy link
Collaborator

#3515 (comment)

This should never happen as only nodes without tags are taken.

Though "Error: this should never happen, it is impossible" is not unusual. Not sure.

Even if it crashes, then crash and clear info that things went horribly wrong would be better than silent data corruption.

Even if it's not currently, there's no reason that function couldn't be used for other barrier related quests which may have barrier set initially (or simply if you add barrier=yes), at which point it would break, so I'd say it's worth changing.

Co-authored-by: Flo Edelmann <florian-edelmann@online.de>
@matkoniecz
Copy link
Member Author

Oh right, that can happen even now as it is now a generic code.

Though "Error: this should never happen, it is impossible" is not unusual.

demonstrated quite well

I would take down entire quest - that I implemented recently, nice one.

Thanks for spotting!

Copy link
Member

@westnordost westnordost left a comment

Choose a reason for hiding this comment

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

Very clean implementation, thank you! Just two small comments:

Co-authored-by: Tobias Zwick <osm@westnordost.de>
@westnordost westnordost changed the base branch from master to 40 January 18, 2022 11:47
@westnordost westnordost merged commit 7e1d848 into streetcomplete:40 Jan 18, 2022
@matkoniecz matkoniecz deleted the intersection branch January 18, 2022 12:04
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.

What type of Stile/Gate/Gap is here?
5 participants