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

Fix invalid or corrupt geometries in data sources that have them #60

Open
florisvdh opened this issue Aug 5, 2021 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@florisvdh
Copy link
Member

florisvdh commented Aug 5, 2021

This applies to the next data source versions (2023); wouldn't do this anymore for current data sources. It was observed that at least QGIS can struggle with this. After fixing geometries in R (st_make_valid()), the below job ran. In #50 (comment) we had decided not to do the fix. However this observation shows we'd better done that.

image

EDIT: further reference is #54 (comment)

Further background: https://r-spatial.org/r/2017/03/19/invalid.html, and updates indicated by https://r-spatial.github.io/sf/news/index.html#version-09-0 and r-spatial/sf#989 (note that only lwgeom::lwgeom_make_valid() still reflects sf::st_make_valid() behaviour at the time of the r-spatial tutorial, i.e. for the corrupt geometry p[5]).

@florisvdh florisvdh added the enhancement New feature or request label Aug 5, 2021
@florisvdh
Copy link
Member Author

florisvdh commented Nov 9, 2023

My current view on this:

  • raw data sources: add a logical argument in the {n2khab} reading functions to optionally fix geometries on the fly (on condition that this is a computationally feasible step for these datasets). Not by default: because we want to stay close to the original (raw) by default and also for backward consistency (cf. former behaviour for existing data source versions).
  • processed data sources: always fix the geometries – i.e. in upcoming versions. For watersurfaces_hab (version watersurfaces_hab_v4) this has been done on an as-needed basis (50ae4b4) by @cecileherr.

@florisvdh florisvdh changed the title habitatmap_stdized, derived and other data sources: preferably fix geometries Fix invalid or corrupt geometries in data sources that have them Aug 9, 2024
@florisvdh
Copy link
Member Author

Successfully tackled by @cecileherr for the upcoming 2023 version of habitatmap derivatives, and the associated n2khab::read_habitatmap() function. For watersurfaces_v1.2 this was handled by PR inbo/n2khab#168.

Leaving this issue open since there are several more raw data sources that may need this.

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

No branches or pull requests

1 participant