moved the version check for filter_hab to the front: in case of a mismatch the error will come up immediately. Otherwise the habitatmap data source is read first, which can take long.
documentation of read_habitatmap_stdized(): adding the exception for "3130,rbbmr" etc. since habitatmap_stdized_2020_v1.
a few minor updates
Also addressed some remaining parts of issue #117. Specifically I propose for the 2018 versions to reorder the xxx_types tibble columns for stdized/terr according to the order of the 2020 datasource version, where this was done in a more logical way. Do you agree? - Also pinging @ToonHub for this one.
Importantly, such new approach of the habitatmap_types table (the non-spatial table in the processed data source) will have to be documented both in the Zenodo metadata (for the new version at least) and read_habitatmap_stdized(). As far as I can tell from habitatmap_stdized metadata it was not (yet) documented what is the primary key for habitatmap_types, but I presume it was polygon_id, type. Now it will become polygon_id, type, certain.
filter_hab
to the front: in case of a mismatch the error will come up immediately. Otherwise thehabitatmap
data source is read first, which can take long.read_habitatmap_stdized()
: adding the exception for"3130,rbbmr"
etc. sincehabitatmap_stdized_2020_v1
.Also addressed some remaining parts of issue #117. Specifically I propose for the 2018 versions to reorder the
xxx_types
tibble columns for stdized/terr according to the order of the 2020 datasource version, where this was done in a more logical way. Do you agree? - Also pinging @ToonHub for this one.Commit 9eff6ec on documenting the key goes back to https://github.com/inbo/n2khab-preprocessing/pull/50#issuecomment-781267400:
Results of testing the functions
``` r library(n2khab) filepaths_2018 <- file.path(fileman_up("n2khab_data"), c("10_raw/habitatmap_2018", "20_processed/habitatmap_stdized_2018/habitatmap_stdized.gpkg", "20_processed/habitatmap_terr_2018/habitatmap_terr.gpkg")) ############################################################# # 2020 ############################################################# read_habitatmap() #> Simple feature collection with 646589 features and 30 fields #> Geometry type: MULTIPOLYGON #> Dimension: XY #> Bounding box: xmin: 21991.38 ymin: 153058.3 xmax: 258871.8 ymax: 244027.3 #> Projected CRS: Belge 1972 / Belgian Lambert 72 #> # A tibble: 646,589 x 31 #> polygon_id eval eenh1 eenh2 eenh3 eenh4 eenh5 eenh6 eenh7 eenh8 v1 v2 #> *