Simplified helper to read a single WFS layer into R using sf.
The function automatically extracts the layer ID from the WFS URL,
assuming the URL pattern .../wfs/<layer>?REQUEST=GetCapabilities....
Arguments
- url
character(1). Full WFS URL (e.g. a GetCapabilities link).
- crs_target
integer(1) or
NULL. EPSG code to reproject the result to. Defaults to25833(ETRS89 / UTM zone 33N). UseNULLto keep native CRS.- bbox
numeric(4) or
NULL. Optional bounding box (c(xmin, ymin, xmax, ymax)), passed to the GetFeature request.- quiet
logical(1). Suppress download messages (default:
FALSE).
Examples
if (FALSE) { # \dontrun{
# Read Berlin ALKIS Bezirke directly from GetCapabilities URL
bezirke <- read_wfs_sf_auto(
"https://gdi.berlin.de/services/wfs/alkis_bezirke?REQUEST=GetCapabilities&SERVICE=wfs"
)
plot(bezirke["bezirk"])
} # }