-
Notifications
You must be signed in to change notification settings - Fork 46
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
Problem with Self-intersection (improper polygon definition) #197
Comments
Thanks! The solution seems feasible to me, and I think this could be added in the tutorial. Additionally, we could consider adding an informative error message with a suggested solution (or even an optional automated fix through function arguments?) in Would be curious to hear if @muuankarski has comments on this before we proceed. |
Thank you very much for your fast response. "Having some fun in the morning" turned into spending a decent amount of time on this :). Your answer motivated me to dig a bit further and I have found some issues on r-spatial/sf#347 discussing the same issue. I assume a fix in
As I now better understand where the problem comes from, the error message is actually quite informative ( Thoughts
Not sure what's the most handy way. Appreciate your efforts! All best, |
This seems a good solution to me (including the last point). I would not be too worried with backward compatibility when implemented this way. Any chance that you could make a PR..? Would be highly appreciated & acknowledged. |
@antagomir appreciate your response; will try to work on a PR before Christmas. No promise as the schedule looks somehow dense, but hope I can find some time for that. I'll come back to you a.s.a.p. |
Great! |
Greatly appreciated @retostauffer. Keep us posted! |
Dear all,
Problem description
One of our students is using your lovely package to interpolate spatial data to NUTS areas. We encountered a problem when using the
sf
object returned byget_eurostat_geospatial()
. In combination with e.g.,st_interpolate_aw()
(areal weighted interpolation). The error thrown:Cause of the problem: The polygons are not defined properly; holes and islands are not treated as such. This inherits from the definition of the boundaries from the original
*.geojson
data sets downloaded viahttps://ec.europa.eu/...
; objects/boundaries defined asLINESTRING
instead ofMULTIPOLYGON
.Possible fix: As I assume changing the original data set is not an option one fix could be applied in
get_eurostat_geospatial()
. The problem can be fixed by applying a buffer with width 0 (sf::st_buffer(x, dist = 0)
) to the polygons. This returns aMULTIPOLYGON
(if needed).Reproducible example
Reproduce error:
Possible fix
Software used:
4.0.2
sf
:0.9.6
eurostat
:3.6.85
(installed via github; today).As I cannot attach an
.html
or.Rmd
document, here is a link to a slightly more extensive description of the issue highlighting the problem by showing some of the polygons causing the problem.Thanks a lot,
Reto
The text was updated successfully, but these errors were encountered: