I was using this code to request NL geometry which was working really well and saved having to store and copy shapefiles for different projects. However, it seems to have stopped working and I can’t figure out why. The code was:
list_of_geos <- c("landsdeel", "provincie", "coropgebied", "gemeente")
## choose year and geometry
for (geo_nam in list_of_geos){
year <- "2021"
url <- parse_url("https://geodata.nationaalgeoregister.nl/cbsgebiedsindelingen/wfs")
url$query <- list(service = "WFS",
version = "2.0.0",
request = "GetFeature",
typename = paste0("cbsgebiedsindelingen:cbs_", geo_nam, "_", year, "_gegeneraliseerd"),
outputFormat = "application/json")
request <- build_url(url)
geo_sf <- st_read(request)
assign(geo_nam, geo_sf)
}
Forgot to mention that, sorry. I’m afraid the emails will be in Dutch, but they will be posted here as well, so you can always ask here if Google Translate messes up too much
Also check the featurenames, those have changed as well: in your example the featurename would resolve to
cbsgebiedsindelingen:cbs_landsdeel_gegeneraliseerd,
but that has become
gebiedsindelingen:landsdeel_gegeneraliseerd
(so without the cbs prefix). Make sure to check the WFS Capabilities for these kinds of changes.