-
Notifications
You must be signed in to change notification settings - Fork 219
Fix/buffer use cluster for within piece #1404
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
base: develop
Are you sure you want to change the base?
Fix/buffer use cluster for within piece #1404
Conversation
} | ||
|
||
if (skip_by_same_cluster(turn, piece)) | ||
{ |
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 is the fix
@@ -140,7 +181,12 @@ class turn_in_piece_visitor | |||
|
|||
if (piece.type == geometry::strategy::buffer::buffered_empty_side) | |||
{ | |||
return false; | |||
return true; |
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 does not make any difference - but it should have been true
228b4d3
to
5ecece1
Compare
5ecece1
to
ed9a0c7
Compare
TEST_BUFFER(rt_w37, join_miter, end_flat, 30.6569, 1.0); | ||
TEST_BUFFER(rt_w38, join_miter, end_flat, 68.2279, 1.0); | ||
TEST_BUFFER(rt_w39, join_miter, end_flat, 46.2279, 1.0); | ||
TEST_BUFFER(rt_w40, join_miter, end_flat, 49.0490, 1.0); |
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 new 5 all fail in develop
What will be the follow-up... The statistics indicate that the I just tested the buffer-unit tests and there are only two regressions, During rewriting graph traversal, some cases were analyzed and postponed because increased the scope too much. These are unfinished - but marked as The I think it's more pragmatic to enable first the robust side strategy - for buffer. |
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.
The code looks good to me and catching something through the algorithm logic before predicate calls seems good.
When running the full test suite on my ARM64 machine (Linux magicbook 5.15.167.4-microsoft-standard-WSL2 #1 SMP Tue Nov 5 00:19:58 UTC 2024 aarch64 GNU/Linux
), I get 10 new test case failures in algorithms_buffer_linestring_geo that I do not get on develop:
[...]/test_buffer_geo.hpp(83): [...] aimes_67_rr has too many points too close 1 0.25
[...]/test_buffer_geo.hpp(107): [...] aimes_67_rr the area is too small, expected at least 1.0038978240812866 15735.3694290676200406610455466882215
[...]/test_buffer_geo.hpp(83): [...] aimes_67_rf has too many points too close 1 0.25
[...]/test_buffer_geo.hpp(107): [...] aimes_67_rf the area is too small, expected at least 1.0038978240812866 13870.0487909986804213579532542697212
[...]/test_buffer_geo.hpp(107): [...] aimes_67_mf the area is too small, expected at least 1.0038978240812866 13870.0487909986804213579532542697212
[...]/test_buffer_geo.hpp(83): [...] aimes_163_rr has too many points too close 0 nan
[...]/test_buffer_geo.hpp(107): [...] aimes_163_rr the area is too small, expected at least 0 6078.31722878943595932505319884877138
[...]/test_buffer_geo.hpp(107): [...] aimes_181_rr the area is too small, expected at least 198.67884304160947 13456.4538307680239549585864667961117
[...]/test_buffer_geo.hpp(83): [...] aimes_163_rr has too many points too close 0 nan
[...]/test_buffer_geo.hpp(107): [...] aimes_163_rr the area is too small, expected at least 0 6078.31722878943595932505319884877138
*** 10 failures are detected in the test module "Test Program"
If they don't occur for you maybe this is related to long double being float128 on my machine (the numbers in this output look like long doubles) and can be ignored and addressed later (since that also causes other errors on develop already on my machine).
Edit: Changing side strategy does not change these 10 additional test failures for me.
|
||
for (auto const& index : it->second.turn_indices) | ||
{ | ||
if (index == turn.turn_index) |
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 produces a comparison of integers of different signedness (long int and size_t) warning in algorithms_buffer_linestring_aimes.test and other tests.
Thanks for testing! Indeed I don't get this. I've arm64 but not float128.
Good you mention this. I tested the buffer algorithms but not yet the geo-ones. I will recheck. The aimes tests are fragile (some of them) - indeed we might ignore them. |
All fine. The only check failing is |
The
|
This is a follow-up of #1369
I wrote it in February, after first PR - and just rebased it and retested it.
It is much smaller.
What can happen that one point is considered as within another piece (that's good) but another clustered piece is not considered as within, or it is considered as within the first piece. This is all caused by floating point behaviour.
It happens with both side strategies (robust and
by_triangle
)This fix is simple, it considers clusters and the pieces involved, and does not even need to perform a within-check in those cases.
Behaviour, before (on current
develop
, this is the same as reported in #1369 but there it was on that branch):Behaviour, after the fix
So roughly 25% improvement. A few of these are added to the unit test suite.
In terms of pictures, it's a big difference often - it cannot make the output if some turns are classified as "within". The orange/red dotted line is the resulting buffer.
Before (the turn labelled as

7
is classified wrongly)After:
