-
Notifications
You must be signed in to change notification settings - Fork 0
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
Update habitatmap_stdized and habitatmap_terr #65
Conversation
This controls the behaviour of the pipe shortcut key in current RStudio versions. This project was already using the magrittr pipe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ToonHub for taking up this work! 👏
The resulting files are perfectly usable and closely align with the setup of the 2020_v1 versions. Some of the below comments will still cause updates of the files though.
Also, I suggest to await the upcoming work by @cecileherr in this repo + in {n2khab}, before uploading the results to Zenodo (hence leave this PR unmerged), just in case she comes across more things that need to be done here. And she may want to review this PR too, as she did in PR #50.
Some of the below comments apply to parts that already existed before, but which I suggest to alter.
Project generate_habitatmap_stdized
-
I've sent PR #67 that goes into this one, essentially with some checks added.
-
I think in the following sentence the commas must be underscores (which have a different meaning here), am I right?
An exception to this rule are following codes:
3130,rbbmr
,3140,rbbmr
,3150,rbbmr
and3160,rbbmr
.
Project generate_habitatmap_terr
- suggestion to apply the same updates as in PR #67.
- see issue #66 : if code will be added to create an update of
habitatmap_terr_2020_v1
first, then that code must be merged into this branch too, even though it won't have an effect on 2023_v1. This is to make sure such update (adding asummarize()
step) would indeed have no effect, and because it would remain in place for future versions too.
Both projects
- Going forward, we should fix invalid and corrupt geometries in processed data sources.
- See issue #60, and the way this has been anticipated in
read_watersurfaces()
(see thefix_geom
argument). - While
read_habitatmap()
has not yet been updated to provide this on-the-fly (and it won't be the default),in the two projectsyou could use some code fromread_watersurfaces()
to update the polygons coming fromhabitatmap_2023
. EDIT: geometry fixing will only be needed ingenerate_habitatmap_stdized
. Projectgenerate_habitatmap_terr
uses the geometries fromhabitatmap_stdized
, so no need for more geometry fixing.
- See issue #60, and the way this has been anticipated in
- Setup chunk: please update the ISO8601 timestamp for the GPKG driver to a 2024 date. The setting stores a reproducible (hence fixed) timestamp in the GeoPackage, but it's still at a 2021 date.
- Regarding storage of different versions, there's inbo/n2khab#113 which needs further handling.
- Whatever strategy will eventually be applied in {n2khab}, I wouldn't add custom subdirectories inside a data source directory as the latter already contains the currently used data source: this approach does not clearly separate multiple data sources. IMO a (default) data source directory should just contain one version of the data source; nothing more since extras would (by convention) also be part of that data source.
- Keeping other versions outside (e.g. next to) the default directory does not need your hack to filter out those subdirectories.
|
||
The ID of each polygon in the habitatmap contains the year in which the polygon | ||
was last updated. | ||
In the table below we show the number of records per type and per update year. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Some suggested updates to PR #65
I accepted the suggestions by @florisvdh in #67 for I also updated the ISO8601 timestamp for both gpkg files. |
Thanks @ToonHub ! @cecileherr when you start your work in this repo, could you pick up these remaining steps too? See above for explanation.
|
…ithub.com/inbo/n2khab-preprocessing into update_habitatmap_stdized_habitatmap_terr
…ies, as it is not possible anymore to extract node coordinates from st_is_valid value
- a.o. remove duplicate label of tables
About fixing geometries in habitatmap (the raw data) with a new I would have liked to add a check of the geometries (detect invalid polygons, visualize them on a map, try to correct them - and see how long it takes - and check the corrected layer) somewhere, so we could see what the impact is of fixing the geometries with Unfortunately (but logically) there is no |
Yes, that would be the most logical place indeed (that directory is mostly about exploration & discussion in preparation of further steps). The file's current contents seem to be checks of Good idea to do the checks that you propose BTW. |
- and remove the geometry corrections
(checks for habitatmap_stdized dropped/moved => generate habitatmap_stdized)
- and a few minor changes/corrections
src/generate_habitatmap_terr/20_generate_habmap_terr_interpreted.Rmd
Outdated
Show resolved
Hide resolved
apply suggestions by florisvdh Co-authored-by: Floris Vanderhaeghe <[email protected]>
- calculate st_is_valid only once - remove a reference tot fix_gem in the sectiona bout the object
Generate habitatmap_stdized, habitatmap_terr, watersurfaces_hab 2023: a few tweaks
I updated habitatmap_stdized and habitatmap_terr based on habitatmap_2023.
I could run most of the original code without any problems.
You find the rendered html-files below.
generating_habitatmap_terr.zip
generating_habitatmap_stdized.zip
Once accepted, I will upload the files to Zenodo.