-
Notifications
You must be signed in to change notification settings - Fork 301
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
for #2063; reproducing rgeos workflow for assigning interior to exterior rings #2069
Conversation
…r to exterior rings
According to the simple feature standard, holes do not share a border segment with the exterior ring. Does this PR bring in non-SF logic into the package? What speaks against making such objects (SF-)valid at this point? |
I'll check and report back - With current a9f1b98 and adding:
to
as expected (holes sharing borders are merged, hole on edge of central exterior ring not found). |
Great, so this is ready to go, right? |
Yes, as far as I can see. Should resolve r-spatial/evolution#9, and rstudio/leaflet#833, where |
Strange enough this passes locally, but fails on windows, see here. Is it OK if I outcomment the test for the 1.0-10 release? |
Which sp version were you using? Winbuilder is on Rtools43, but I'm sure with released sp. My local testing was on Fedora with sp fixed for the |
Did you also update to: https://svn.r-project.org/R-dev-web/trunk/WindowsBuilds/winutf8/ucrt3/r_packages/patches/CRAN/sf.diff for GDAL 3.6.2 ? I think Win-builder has an intermediate version with older GEOS - maybe a cause? Trying now ... |
With R Under development (unstable) (2023-01-03 r83550 ucrt), matching Rtools with GDAL 3.6.2 and GEOS 3.11.1: |
With released CRAN sf and GEOS 3.9.3, I see (in debug and after pasting in the new process_pl_comment()):
so maybe a dependency on GEOS versions later than 3.9.3? Shall I try to establish which? Should we condition this part of
|
Confirmed that with GEOS 3.9.4 on Fedora, |
r-spatial/evolution#9, rstudio/leaflet#833
This is not optimized at all, but since it is unlikely to be entered unless someone has canned, stale sp polygon objects in their workflows, speed doesn't matter. Here the workhorse is:
st_contains_properly(raw0[!holes], raw0[holes])
, whereholes
are got from the input object. If no holes were assigned initially, the flow of control reverts effectively to the previous code.st_contains_properly()
may fail if a quasi-hole shares a border segment with its containing exterior ring. Holes are assigned as interior rings to exterior rings in order of exterior ring area from smallest to largest (the nested island/holes case), and assigned holes the dropped from the larger exterior rings.