-
Notifications
You must be signed in to change notification settings - Fork 13
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
Polygons disappear after ms_erase #110
Labels
Comments
Hi @sandra-ab - thanks for the excellent bug report! I'll investigate shortly |
Hi @sandra-ab - it seems to have been a bug with the bundled version of mapshaper I was using. I've upgraded it, can you test with the development version? You can install with: # install.packages("remotes")
remotes::install_github("ateucher/rmapshaper", ref = "fix-erase-bug") |
Merged
Thank you so much @ateucher - works perfectly now! |
That's excellent - thank you for the report! |
ateucher
added a commit
that referenced
this issue
May 20, 2021
Upgrade mapshaper to 0.4.163 - Fix erase bug #110 + other improvements
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
First of all thanks for rmapshaper, it is a wonderfully handy package.
I have been occasionally encountering a quirk using
ms_erase
and can’t really figure out what is happening.For context, I am using the function in a habitat mapping toolkit, and users can supply their own spatial file of hedgerows that then get added to a vector land cover map (OS MasterMap). The (simplified) workflow for this is:
ms_erase
) the corresponding area from the basemap polygonsNow this works beautifully almost every time (> 99.9%), but once in a while the returned output of
ms_erase
is missing part of a polygon, leaving a gaping hole in my map. In the example here, I also noticed that this does not happen when I use the system rmapshaper instead. The plot shows my two input layers (left), the problem (center), and the expected correct outcome (right; using system rmapshaper or QGIS).Sorry I couldn’t reproduce the problem with simpler data, but as I said it only happens very rarely - and I can't figure out what combination of features sets it off (all input polygons are valid sf single-part polygons). I am attaching the two layers shown in the plots: hedgemap.zip
Any pointers on what the problem might be would be greatly appreciated. I would prefer not forcing my users to install Node.js.
My code:
And the output of
sessionInfo()
:Thank you,
Sandra
The text was updated successfully, but these errors were encountered: