-
-
Notifications
You must be signed in to change notification settings - Fork 764
Fix rivers #586
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
Fix rivers #586
Conversation
|
|
||
| /// Clips a way to the bounding box boundaries using Sutherland-Hodgman algorithm for polygons | ||
| /// or simple line clipping for polylines | ||
| fn clip_way_to_bbox( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug #1 is in here somewhere - we end up chopping things off incorrectly. I've removed this code as it seems like a lot of logic that shouldn't actually be doing much (generally our element processing clamps things to within bounds anyway, right?). But I also understand someone spent a lot of time writing this in the first place. I just don't personally want to be the one to figure out what is wrong in here (plus, there may be more bugs lurking here)
| } | ||
|
|
||
| // Process each outer polygon individually | ||
| for (i, outer_nodes) in outers.iter().enumerate() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pretty much fully reverted this. Bug #2 is that processing each polygon individually completely ruins the point of the merge_loopy_loops function
| } | ||
| } | ||
|
|
||
| if !nodes.is_empty() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These various changes is so we don't accidentally exclude a node/way that's being used in our relation
|
|
||
| merge_loopy_loops(&mut inners); | ||
| if !verify_loopy_loops(&inners) { | ||
| // If inners are invalid, process outer without inners |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also didn't seem like a great fallback to me. If the inner loop is invalid we probably don't want to just fill it in!
Fixed docks as well in the latest commit. https://wiki.openstreetmap.org/wiki/Key:waterway Apparently "waterway=dock" represents a water area, so I've implemented that |
|
Incredible work as always. Tons of thanks to you! Minecraft then replaces the faulty chunks with the standard generated flat Minecraft "terrain". I fixed it locally to try out the waterway generation. Could you check back on your end if this regression is introduced by this PR? |
|
@louis-e Yeah that's a regression introduced by my other PR. I'll remove the commit from this so it's not blocking |
|
@louis-e done |
|
Perfect, thank you so much! |



With
argo run --release -- --bbox 45.943511,-66.675682,45.981934,-66.605644 --path server/world --ground-level 80 --terrain --fillground --interior --roof --debugI get this:my river is restored (:
this was the result of 2 separate bugs.