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

Collapsing degenerate roads breaks #204

Closed
dabreegster opened this issue Feb 17, 2023 · 5 comments · Fixed by #205
Closed

Collapsing degenerate roads breaks #204

dabreegster opened this issue Feb 17, 2023 · 5 comments · Fixed by #205
Labels
bug Something isn't working

Comments

@dabreegster
Copy link
Contributor

https://a-b-street.github.io/osm2streets/#18.41/51.47558/-2.53673
When we collapse degenerate roads, the geometry somewhere blows up, and then this makes us incorrectly collapse a road

screencast.mp4
@dabreegster dabreegster added the bug Something isn't working label Feb 17, 2023
@dabreegster
Copy link
Contributor Author

Before collapsing, something very wrong is happening with clockwise ordering. The north and south intersection both supposedly have 4 roads connected?! And where are the labels?
Screenshot from 2023-02-17 15-49-51

@dabreegster
Copy link
Contributor Author

Ah my mistake, the road ordering layer is relative to the final output, not each debug step

@dabreegster
Copy link
Contributor Author

dabreegster commented Feb 17, 2023

I think

for trim_to in all_intersection_infinite(&center_away, &perp) {
is messing up between r7 and r8. These two form a loop, and we're winding up trimming to the wrong end.
331421547_581164990553759_6839840073187760828_n

@BudgieInWA
Copy link
Collaborator

I have a theory that the intersection geometry code give up any time there is a loop road. That would explain the circle at the end.

But the messed up geometry at step 6 is a different problem. I agree that it looks like the wrong end of r8 is being used. But maybe only for some of the calculations? It looks like the algorithm asks about the intersection between r7 and r8 without specifying which end of each road it cares about?

@dabreegster
Copy link
Contributor Author

It looks like the algorithm asks about the intersection between r7 and r8 without specifying which end of each road it cares about?

This might be it..

I had a fuzzy thought earlier about how we trim the center line back based on a hit point from the projected left or right line. Right now we either maximize or minimize the length of the resulting polyline, in an attempt to find the one "closest to the intersection." I might try minimizing the distance to the actual hit point we found.. because it should pretty much always be about road_width / 2 away.

I'll try both of these ideas out and try and figure this out finally. Loop roads have caused enough trouble!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants