Retrieve spatial building data through two types of WFS queries:
By bounding box:
catr_wfs_get_buildings_bbox()retrieves objects included in the provided bounding box. See Bounding box.
By cadastral reference:
catr_wfs_get_buildings_rc()retrieves objects for specific cadastral references.
Arguments
- x
Input defining the query area. See Bounding box. It can be:
- what
Information to load, either
"building"for buildings,"buildingpart"for parts of a building or"other"for other elements such as swimming pools.- srs
SRS/CRS to use in the query. To see allowed values, use catr_srs_values, specifically the
wfs_servicecolumn. See Bounding box.- verbose
Logical. Whether to display informational messages.
- rc
Cadastral reference to retrieve.
Bounding box
When x is a numeric vector, make sure that srs matches the
coordinate values. This function queries the bounding box in
EPSG:25830, ETRS89 / UTM zone 30N, to work around a
potential API issue.
When x is an sf object, the srs value is ignored. In
this case, the bounding box of the sf object is
used for the query (see sf::st_bbox()).
The result uses the SRS of the input spatial object or the srs value
provided with a numeric vector.
See also
catr_wms_get_layer() downloads a map image using the returned spatial
object as its extent (x).
Work with cadastral buildings:
catr_atom_get_buildings(),
catr_atom_get_buildings_db_all()
Query WFS INSPIRE services:
catr_wfs_get_address_bbox(),
catr_wfs_get_parcels_bbox(),
inspire_wfs_get()
Examples
# \donttest{
# Using a bounding box
building <- catr_wfs_get_buildings_bbox(
c(
376550,
4545424,
376600,
4545474
),
srs = 25830
)
library(ggplot2)
ggplot(building) +
geom_sf() +
labs(title = "Search using a bounding box")
# Using a cadastral reference
rc <- catr_wfs_get_buildings_rc("6656601UL7465N")
library(ggplot2)
ggplot(rc) +
geom_sf() +
labs(title = "Search using rc")
# }
