Skip to content
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

erase_overlaps problem: many areas are not erased #73

Closed
Va99le opened this issue Sep 9, 2023 · 6 comments
Closed

erase_overlaps problem: many areas are not erased #73

Va99le opened this issue Sep 9, 2023 · 6 comments
Labels

Comments

@Va99le
Copy link

Va99le commented Sep 9, 2023

Hi Jeffrey, I'm sorry to bother you again. I' m having some trouble with "wdpa_clean", particularly with erase overlaps. I am performing a fine scale analysis on a european level, so precision matters. After performing the cleaning procedures on multiple countries, and checking them against the "dissolved" version of the PA of same state ("wdpa_dissolve", used after that in "wdpa_clean" erase_overlaps= FALSE), I realized that many area were not erased, since there is a significant differences in the area between the dissolved state and the erased one. The values are significantly higher for the erased one. Checking the files on Qgis, i realized there were many overlapping parts, like the one in the pictures (which is only provided as an example):
image
image
image
As in the picture, the Pilat area is a bigger area, with a defined IUCN category of protection (V), while the smaller area Crts du Pilat, located inside the previus one, has no IUCN category (not reported). Also, the pilat area was designed well before the Crts du Pilat (1974 vs 2014), so it should have been erased. The same is true for many other areas.

For example, in Italy the dissolved area is about 69 561 Km^2 (after performing st_intersection() with Italy's border as provided by the Global Administrative Areas dataset), while his area after the erase_overlaps is of 76 354 km^2.

Is there something I can do to fix the problem? Is there something I 'm getting wrong?

Thank you

@jeffreyhanson
Copy link
Collaborator

Hi,

Sorry the for the late reply @Va99le! Wow, yeah, that's definitely not correct. Thank you very much for reporting this. I'll take a look at this and see what I can do.

jeffreyhanson added a commit that referenced this issue Sep 18, 2023
jeffreyhanson added a commit that referenced this issue Sep 18, 2023
@jeffreyhanson
Copy link
Collaborator

I think I've found a fix - can you please try running it again with the fix-73 branch? If it works, I'll merge into the main branch. To install the branch, please use this code:

remotes::install_github('prioritizr/wdpar@fix-73')

@Va99le
Copy link
Author

Va99le commented Sep 18, 2023

It worked! Thank you very much! Now the area of the erased file is the same as the dissolved one.
Thank you again for your time and work

@jeffreyhanson
Copy link
Collaborator

Awesome! Just to check, since your first message indicated that the update didn't work - was there any installation issues or changes to your cleaning code that needed to be fixed to get it to work?

@Va99le
Copy link
Author

Va99le commented Sep 19, 2023

I made a mistake in the code: I recalled the packages and after that I run the fix line, and then the cleaning code. I should have recalled the packages after the installation of the fix. I didn't realize at first!

@jeffreyhanson
Copy link
Collaborator

Ah ok - thanks for clarifying that. I'll merge the PR and then prepare an update to get the fix on CRAN. Thanks again for reporting this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants