Fetches vector features from a WFS, OGC API Features, or ArcGIS REST
endpoint and returns a tibble with a wk::wkb geometry column.
wfs_read(
base_url,
layer,
bbox = NULL,
max_features = 100,
where = NULL,
driver = "auto",
version = NULL,
srs = NULL,
convert_linear = TRUE,
promote_to_multi = FALSE
)Character. The service endpoint URL.
Character. Layer name to read. Use wfs_layers() to
discover available layers.
Numeric vector of length 4 (xmin, ymin, xmax, ymax)
or NULL for no spatial filter. Coordinates should be in the SRS
specified by srs (or the layer's native SRS if srs is NULL).
Integer or NULL. Maximum number of features to
request. For WFS, passed as count in the URL. For other drivers,
features are truncated after fetch.
Character or NULL. An OGR SQL WHERE clause to filter
features by attribute.
Character. Driver hint; see wfs_connection().
Character or NULL. WFS version (e.g. "2.0.0").
Character or NULL. Target SRS as "EPSG:XXXX".
Logical. If TRUE (default), convert
circular arc geometries to linear approximations.
Logical. If TRUE, promote single-part
geometries to multi-part. Default FALSE.
A tibble::tibble with attribute columns and a geometry
column of class wk::wkb.
if (FALSE) { # \dontrun{
# Tasmania LIST: cadastral parcels in Sandy Bay
parcels <- wfs_read(
wfs_example_url("list_tasmania"),
layer = "Public_OpenDataWFS:LIST_Cadastral_Parcels",
bbox = wfs_example_bbox("sandy_bay"),
srs = "EPSG:28355",
max_features = 100
)
parcels
wk::wk_plot(parcels$geometry)
# Esri sample world cities
cities <- wfs_read(
wfs_example_url("esri_sample"),
layer = "esri:cities"
)
} # }