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

typology evaluation errors in wdpa_clean #20

Closed
JonasGeschke opened this issue Feb 18, 2020 · 21 comments
Closed

typology evaluation errors in wdpa_clean #20

JonasGeschke opened this issue Feb 18, 2020 · 21 comments
Assignees

Comments

@JonasGeschke
Copy link

in addition to #19, I came across the following error in the "DNK" (Denmark) subset:

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

@JonasGeschke
Copy link
Author

same in the "GRC" (Greece) subset:

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

@JonasGeschke
Copy link
Author

JonasGeschke commented Feb 18, 2020

(just putting it down here to have a collection where errors pop up. the more often they appear, the more general the problem probably is ...)

@JonasGeschke
Copy link
Author

same in the "BGR" (Bulgaria) subset:

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

@JonasGeschke
Copy link
Author

same but different in the "AUT" (Austria) subset:

Error in CPL_geos_op2(op, st_geometry(x), st_geometry(y)) :
Evaluation error: TopologyException: no outgoing dirEdge found at 1243901 5365689.0999999996.

@JonasGeschke JonasGeschke changed the title typology evaluation error in wdpa_clean typology evaluation errors in wdpa_clean Feb 18, 2020
@JonasGeschke
Copy link
Author

just see similar errors are dealt with in #13. are the code fixes already on CRAN?

@JonasGeschke
Copy link
Author

error in "BEL" Belgium subset:

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

@JonasGeschke
Copy link
Author

error in "BRA" Brazil subset:

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

@jeffreyhanson
Copy link
Collaborator

Thanks for reporting this - I'll take a look and see what I can do. In the meantime, if you're planning on dissolving all the polygons together or rasterizing the polygons then you can skip this "erasing overlaps" step erase_overlaps = TRUE.

@jeffreyhanson jeffreyhanson self-assigned this Feb 18, 2020
@JonasGeschke
Copy link
Author

Thanks for checking it. Probably the errors are done with the fix in #13, I didnt check this.

@JonasGeschke
Copy link
Author

another error in "ITA" (Italy):

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

@JonasGeschke
Copy link
Author

another error in "ESP" (Spain):

Error in CPL_geos_union(st_geometry(x), by_feature) :
Evaluation error: TopologyException: Input geom 0 is invalid: Self-intersection at or near point -517842 4727376.2839926593 at -517842 4727376.2839926593.

@JonasGeschke
Copy link
Author

another error in "GBR" (United Kingdom):

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

@JonasGeschke
Copy link
Author

I now re-run cleaning with the development version of wdpar. I mark all errors that are resolved with a thumb-up ...

@JonasGeschke
Copy link
Author

Thanks for reporting this - I'll take a look and see what I can do. In the meantime, if you're planning on dissolving all the polygons together or rasterizing the polygons then you can skip this "erasing overlaps" step erase_overlaps = TRUE.

As a simple feedback question to this point: Sounds like you wouldn't use wdpa_clean for dissolving the WDPA. How would you do it?

@JonasGeschke
Copy link
Author

For now, with use of the development version of wdpar, only GRC keeps to result in the error:

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

// Germany and US subset still to be done ...

@JonasGeschke
Copy link
Author

JonasGeschke commented Feb 21, 2020

error in "DEU" (Germany):

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

@JonasGeschke
Copy link
Author

also in "USA":

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

@jeffreyhanson
Copy link
Collaborator

Hmm, you might need to increase the precision of the geometry calculations for these datasets. Try increasing the geometry_precision argument to 1e+6 or 1e+8 in wdpa_clean. This makes the geoprocesssing more robust/correct, but increases run time, so finding the right balance can be tricky.

jeffreyhanson added a commit that referenced this issue Feb 29, 2020
@jeffreyhanson
Copy link
Collaborator

jeffreyhanson commented Feb 29, 2020

I've just pushed a patch which should make the overlap erasing procedure in wdpa_clean more robust, so hopefully this fixes the issues you're experiencing. Could you please try with the latest version?

jeffreyhanson added a commit that referenced this issue Feb 29, 2020
@JonasGeschke
Copy link
Author

Great, thanks, I will let you know how it works out.

@JonasGeschke
Copy link
Author

Working with the development version of wdpar, there are currently no typology evaluation errors anymore (even without changing the precision).

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

No branches or pull requests

2 participants