prioritizr / wdpar

Interface to the World Database on Protected Areas
https://prioritizr.github.io/wdpar
GNU General Public License v3.0
39 stars 5 forks source link

I used the newest version of wdpar, still have this "side location conflict" #48

Closed sahmoli closed 2 years ago

sahmoli commented 2 years ago

Error in CPL_geos_binop(st_geometry(x), st_geometry(y), op, par, pattern, : Evaluation error: TopologyException: side location conflict at 678942 5359610.1668073526.

What should I do with this?

Thank you so much.

jeffreyhanson commented 2 years ago

Hi @sahmoli,

My guess would be that there's a protected area with an invalid geometry that the code for repairing geometries is unable to fix. Could you please put togeather a small reprex to help me debug this? Also, are you processing the data for a specific country?

sahmoli commented 2 years ago

I am processing the shapefile of the global protected area downloaded from protectedplanet.org (the May 2022 version). It has three shapefiles in total. I successfully cleaned with erase_overlaps = TRUE of one of them, but the other two shapefiles encountered this error.

sahmoli commented 2 years ago

Maybe because the original dataset is too big, it seems like it took reprex() forever to make a reproducible example.

sahmoli commented 2 years ago

Need I send you the shapefile which encountered the error?

jeffreyhanson commented 2 years ago

Yeah, could you please save the R object as an RDS file using saveRDS and send that to me? Also, one option could be to try playing around with the parameters used in wdap_clean() (e.g., snap_tolerance and geometry_precision). By increasing them, this will make the geporcessing more robust (but run slower).

sahmoli commented 2 years ago

Thank you so much. I just send you an email with the link of r and rds files.

At the same time, I will try to edit the parameters used in wdap_clean() (e.g., snap_tolerance and geometry_precision) and try again.

On Wed, Jun 1, 2022 at 4:35 AM Jeff Hanson @.***> wrote:

Yeah, could you please save the R object as an RDS file using saveRDS and send that to me? Also, one option could be to try playing around with the parameters used in wdap_clean() (e.g., snap_tolerance and geometry_precision). By increasing them, this will make the geporcessing more robust (but run slower).

— Reply to this email directly, view it on GitHub https://github.com/prioritizr/wdpar/issues/48#issuecomment-1142615935, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXIIQ5YDLUVQSX7B5GEJITVMZZZLANCNFSM5XDG3AUQ . You are receiving this because you were mentioned.Message ID: @.***>

jeffreyhanson commented 2 years ago

I think we managed to solve this over email, so I'll close this now. Please feel free to re-open if needed?