Fix degenerate linestring relation on boundary of areal#1474
Conversation
| update<boundary, interior, '0', TransposeResult>(m_result); | ||
| m_interrupt_flags |= 4; | ||
| } | ||
| else |
There was a problem hiding this comment.
Should we handle pig == 0 here too?
There was a problem hiding this comment.
A degenerate linestring does not have a boundary itself, so this case shouldn't be possible I believe.
|
Thanks for the PR, is it a bit larger than earlier? Anyway, that's not a problem, will continue the review later |
Adding the handling of the interrupt flags for this case now made it a bit bigger yes |
tinko92
left a comment
There was a problem hiding this comment.
Thank you for the PR. The changes look suitable to me for but the goal of this PR is but I have not yet run the full test suite locally.
I have two general questions on this approach:
- Have you considered your approach against an implementation on the dispatch level, i.e. before the dispatch to the detail/relate/linear_areal code test the linestring for degeneracy and call the detail/relate/point_geometry code in case of degeneracy? This way may be easier and and more clear to wrap into a macro guard to allow restoring the old behaviour.
- Related to this (and mentioned in another code comment) since we change behavior here, do we want a macro that can be defined to restore the old behavior?
|
|
||
| if ( ! may_update<interior, boundary, '1', TransposeResult>(m_result) ) | ||
| { | ||
| m_interrupt_flags |= 0x10; |
There was a problem hiding this comment.
This is not so easy to review. Something like
private:
constexpr static unsigned flag_interior_interior = 0x01;
// ...
constexpr static unsigned flag_interior_boundary = 0x10;
constexpr static unsigned flag_all = flag_interior_interior | /* ... */ | flag_interior_boundary;
// ...
m_interrupt_flags |= flag_interior_boundary;may be more clear.
There was a problem hiding this comment.
I agree, I was just following what was there before, trying to keep the change set small. I am happy to follow the suggestion to make it more readable if desired
| m_interrupt_flags |= 1; | ||
| m_interrupt_flags |= 0x01; | ||
| } | ||
| else if ( pig == 0 ) |
There was a problem hiding this comment.
Do we want some BOOST_GEOMETRY_... guard macro around this? Since this changes behavior we may want to include in the next changelog after this gets pulled as breaking, and if a user (possibly unknowingly since past issue reports suggest the geometric predicate names can be non-intuitive to some) relies on the old behaviour, they could define it.
There was a problem hiding this comment.
I would think that we don't need macro's for changed behaviour on degenerate linestrings.
But we should add it to the release notes.
I'm not sure if this is necessary for this fix. |
My concern with that was that checking the linestring for degeneracy didn't seem completely trivial. Checking |
Basically makes it so
covered_byreturnstrueforLINESTRING(0 0,0 0)andPOLYGON((0 0, 0 2, 2 2, 2 0, 0 0))instead offalseas it did previously, which could be quite surprising.Fixes #1473
The bit flags for interrupt aren't exactly pretty, but it follows the present implementation.