Closed karpfen closed 1 month ago
Hi @karpfen, so I had some issues with opening the data set for 2018 with GDAL which now I am unable to reproduce... I will re-enable 2018 as a valid year and let's hope that nothing else pops up!
Hi @goergen95, that's strange, your fix is exactly what I tried first yesterday, but it still doesn't seem to work for me. I just ran this snippet in with an empty data directory:
remotes::install_github("mapme-initiative/mapme.biodiversity", ref = "dev")
library(sf)
library(mapme.biodiversity)
mapme_options(outdir = tempdir(), verbose = TRUE)
x <- read_sf(
system.file("extdata", "shell_beach_protected_area_41057_B.gpkg",
package = "mapme.biodiversity"
)
)
x <- get_resources(x, get_gmw(years = 2018:2019))
resources <- prep_resources(x)
names(resources$gmw)
# [1] "gmw_v3_2018_vec.gpkg" "gmw_v3_2019_vec.gpkg"
Is there anything else I could be doing wrong?
Ah, now I got it! I did not translate the 2018 data to geodetic coordinates which resulted in no intersections. Please find b5b12d5 which should work now. I also adapted your sample code a little bit to make it run on other machines as well. Please re-open if the issue persists.
Aah, that was it. Thanks @goergen95!
In the Global Mangrove Watch resource function, 2018 is excluded as a valid year.
However, there is also some code included, specifically to deal with the 2018 data. I was trying to fix this manually by using a custom resource function:
This seems to work for downloading the data, but
prep_resources()
still doesn't return the 2018 data. For now, I didn't manage to dig further into the problem, maybe we can have a look together this week, @goergen95