Retrieve spatial address data through several types of WFS queries:
By bounding box:
catr_wfs_get_address_bbox()retrieves objects included in the provided bounding box. See Bounding box.
By street code:
catr_wfs_get_address_codvia()retrieves objects for specific addresses.
By cadastral reference:
catr_wfs_get_address_rc()retrieves objects for specific cadastral references.
By postal codes:
catr_wfs_get_address_postalcode()retrieves objects for specific postal codes.
Usage
catr_wfs_get_address_bbox(x, srs = NULL, verbose = FALSE)
catr_wfs_get_address_codvia(codvia, del, mun, srs = NULL, verbose = FALSE)
catr_wfs_get_address_rc(rc, srs = NULL, verbose = FALSE)
catr_wfs_get_address_postalcode(postalcode, srs = NULL, verbose = FALSE)Arguments
- x
Input defining the query area. See Bounding box. It can be:
A numeric vector of length 4 with the coordinates that define the bounding box:
c(xmin, ymin, xmax, ymax).An
sforsfcobject from sf.
- 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. If
TRUE, displays informational messages.- codvia
Cadastral street code.
- del
Cadastral office code.
- mun
Cadastral municipality code.
- rc
Cadastral reference to retrieve.
- postalcode
Postal code.
Value
An sf object. Returns NULL if the data cannot be
retrieved.
Bounding box
When x is a numeric vector, make sure that the srs matches the
coordinate values. Additionally, the function queries the bounding box on
EPSG:25830, ETRS89 / UTM zone 30N, to work around a
potential API issue.
When x is a sf object, the value srs is ignored. In
this case, the bounding box of the sf object is
used for the query (see sf::st_bbox()).
The result is always provided in the SRS of the sf object
provided as input.
See also
Query data from WFS INSPIRE services:
catr_wfs_get_buildings_bbox(),
catr_wfs_get_parcels_bbox(),
inspire_wfs_get()
Work with cadastral addresses:
catr_atom_get_address(),
catr_atom_get_address_db_all()
Examples
# \donttest{
ad <- catr_wfs_get_address_bbox(
c(
233673, 4015968, 233761, 4016008
),
srs = 25830
)
#> ✖ The download request could not be completed.
#> ! Failed to perform HTTP request.
#> Caused by error in `curl::curl_fetch_memory()`:
#> ! Failure when receiving data from the peer [ovc.catastro.meh.es]:
#> Recv failure: Connection reset by peer
#> → Returning "NULL" because the download failed.
library(ggplot2)
ggplot(ad) +
geom_sf()
# }
