Skip to content

Fix degenerate linestring relation on boundary of areal#1474

Open
mjacobse wants to merge 3 commits into
boostorg:developfrom
mjacobse:fix_relate_degenerate_linestring
Open

Fix degenerate linestring relation on boundary of areal#1474
mjacobse wants to merge 3 commits into
boostorg:developfrom
mjacobse:fix_relate_degenerate_linestring

Conversation

@mjacobse

Copy link
Copy Markdown
Contributor

Basically makes it so covered_by returns true for LINESTRING(0 0,0 0) and POLYGON((0 0, 0 2, 2 2, 2 0, 0 0)) instead of false as 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.

Comment thread include/boost/geometry/algorithms/detail/relate/linear_areal.hpp
Comment thread include/boost/geometry/algorithms/detail/relate/linear_areal.hpp
update<boundary, interior, '0', TransposeResult>(m_result);
m_interrupt_flags |= 4;
}
else

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should we handle pig == 0 here too?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

A degenerate linestring does not have a boundary itself, so this case shouldn't be possible I believe.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

All right

@barendgehrels

Copy link
Copy Markdown
Collaborator

Thanks for the PR, is it a bit larger than earlier? Anyway, that's not a problem, will continue the review later

@mjacobse

Copy link
Copy Markdown
Contributor Author

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

Comment thread include/boost/geometry/algorithms/detail/relate/linear_areal.hpp
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.

Surprising relation results for degenerate linestring on boundary of areal

2 participants