Title: | Interface to the 'INSPIRE' services of 'Catastro de Navarra' |
---|---|
Description: | Access public spatial data available under the 'INSPIRE' directive. Tools for downloading references, buildings and addresses of properties on Navarre (Spain). |
Authors: | Diego Hernangómez [aut, cre] |
Maintainer: | Diego Hernangómez <[email protected]> |
License: | CC BY 4.0 |
Version: | 0.1.0 |
Built: | 2024-11-20 15:24:59 UTC |
Source: | https://github.com/rOpenSpain/CatastRoNav |
Get the spatial data of all the cadastral parcels belonging to a single municipality using the INSPIRE ATOM service.
catrnav_atom_get_parcels( munic, cache = TRUE, update_cache = FALSE, cache_dir = NULL, verbose = FALSE )
catrnav_atom_get_parcels( munic, cache = TRUE, update_cache = FALSE, cache_dir = NULL, verbose = FALSE )
munic |
Municipality to extract, It can be a part of a string or the cadastral code. See catrnav_atom_get_parcels_db_all. |
cache |
A logical whether to do caching. Default is |
update_cache |
A logical whether to update cache. Default is |
cache_dir |
A path to a cache directory. On missing value the function
would store the cached files on a temporary dir (See |
verbose |
Logical, displays information. Useful for debugging,
default is |
A sf
object.
Other ATOM:
catrnav_atom_get_parcels_db_all()
Other parcels:
catrnav_atom_get_parcels_db_all()
,
catrnav_wfs_get_parcels_bbox()
s <- catrnav_atom_get_parcels("Iruña") library(ggplot2) ggplot(s) + geom_sf() + labs( title = "Cadastral Zoning", subtitle = "Pamplona / Iruña" )
s <- catrnav_atom_get_parcels("Iruña") library(ggplot2) ggplot(s) + geom_sf() + labs( title = "Cadastral Zoning", subtitle = "Pamplona / Iruña" )
Create a database containing the urls provided in the INSPIRE ATOM service for extracting Cadastral Parcels.
catrnav_atom_get_parcels_db_all( cache = TRUE, update_cache = FALSE, cache_dir = NULL, verbose = FALSE )
catrnav_atom_get_parcels_db_all( cache = TRUE, update_cache = FALSE, cache_dir = NULL, verbose = FALSE )
cache |
A logical whether to do caching. Default is |
update_cache |
A logical whether to update cache. Default is |
cache_dir |
A path to a cache directory. On missing value the function
would store the cached files on a temporary dir (See |
verbose |
Logical, displays information. Useful for debugging,
default is |
A tibble with the information requested:
munic
: Name of the municipality.
url
: url for downloading information of the corresponding municipality.
date
: Reference date of the data.
Other ATOM:
catrnav_atom_get_parcels()
Other parcels:
catrnav_atom_get_parcels()
,
catrnav_wfs_get_parcels_bbox()
catrnav_atom_get_parcels_db_all()
catrnav_atom_get_parcels_db_all()
Use this function with caution. This function would clear your cached data and configuration, specifically:
Deletes the CatastRoNav config directory
(rappdirs::user_config_dir("CatastRoNav", "R")
).
Deletes the cache_dir
directory.
Deletes the values on stored on Sys.getenv("CATASTRONAV_CACHE_DIR")
.
catrnav_clear_cache(config = FALSE, cached_data = TRUE, verbose = FALSE)
catrnav_clear_cache(config = FALSE, cached_data = TRUE, verbose = FALSE)
config |
if |
cached_data |
If this is set to |
verbose |
Logical, displays information. Useful for debugging,
default is |
This is an overkill function that is intended to reset your status as it you would never have installed and/or used CatastRoNav.
Invisible. This function is called for its side effects.
Other cache utilities:
catrnav_set_cache_dir()
# Don't run this! It would modify your current state ## Not run: catrnav_clear_cache(verbose = TRUE) ## End(Not run) Sys.getenv("CATASTRONAV_CACHE_DIR")
# Don't run this! It would modify your current state ## Not run: catrnav_clear_cache(verbose = TRUE) ## End(Not run) Sys.getenv("CATASTRONAV_CACHE_DIR")
catrnav_set_cache_dir()
will store your cache_dir
path on your local
machine and would load it for future sessions.
Alternatively, you can store the cache_dir
manually with the following
options:
Run Sys.setenv(CATASTRONAV_CACHE_DIR = "cache_dir")
. You would need to
run this command on each session (Similar to install = FALSE
).
Write this line on your .Renviron file:
CATASTRONAV_CACHE_DIR = "value_for_cache_dir"
(same behavior than
install = TRUE
). This would store your cache_dir
permanently.
catrnav_detect_cache_dir()
detects and returns the path to your current
cache_dir
.
catrnav_set_cache_dir( cache_dir, overwrite = FALSE, install = FALSE, verbose = TRUE ) catrnav_detect_cache_dir(...)
catrnav_set_cache_dir( cache_dir, overwrite = FALSE, install = FALSE, verbose = TRUE ) catrnav_detect_cache_dir(...)
cache_dir |
A path to a cache directory. On missing value the function
would store the cached files on a temporary dir (See |
overwrite |
If this is set to |
install |
if |
verbose |
Logical, displays information. Useful for debugging,
default is |
... |
Ignored |
catrnav_set_cache_dir()
is called for its side effects, and returns an
(invisible) character with the path to your cache_dir
.
catrnav_detect_cache_dir()
returns the path to the cache_dir
used in this
session
Sometimes cached files may be corrupt. On that case, try re-downloading
the data setting update_cache = TRUE
.
If you experience any problem on download, try to download the
corresponding file by any other method and save it on your
cache_dir
. Use the option verbose = TRUE
for debugging the API query.
Other cache utilities:
catrnav_clear_cache()
# Don't run this! It would modify your current state ## Not run: catrnav_set_cache_dir(verbose = TRUE) ## End(Not run) catrnav_detect_cache_dir()
# Don't run this! It would modify your current state ## Not run: catrnav_set_cache_dir(verbose = TRUE) ## End(Not run) catrnav_detect_cache_dir()
Get the spatial data of addresses by bounding box.
catrnav_wfs_get_address_bbox(x, srs, verbose = FALSE, count = NULL)
catrnav_wfs_get_address_bbox(x, srs, verbose = FALSE, count = NULL)
x |
See Details. It could be:
|
srs |
SRS/CRS to use on the query. See Details. |
verbose |
Logical, displays information. Useful for debugging, default
is |
count |
integer, indicating the maximum number of features to return.
The default value |
When x
is a numeric vector, make sure that the srs
matches the coordinate
values. Additionally, when the srs
correspond to a geographic reference system
(4326, 4258), the function queries the bounding box on
EPSG:25830 - ETRS89 / UTM zone 30N. The result is
provided always in the SRS provided in srs
.
When x
is a sf
object, the value srs
is ignored. The query is
performed using EPSG:25830 (ETRS89 / UTM zone 30N) and
the spatial object is projected back to the SRS of the initial object.
A sf
object.
CatastRo::catr_wfs_get_address_bbox()
downtown <- c(-1.646812, 42.814528, -1.638036, 42.820320) ad <- catrnav_wfs_get_address_bbox(downtown, srs = 4326) library(ggplot2) ggplot(ad) + geom_sf()
downtown <- c(-1.646812, 42.814528, -1.638036, 42.820320) ad <- catrnav_wfs_get_address_bbox(downtown, srs = 4326) library(ggplot2) ggplot(ad) + geom_sf()
Get the spatial data of buildings by bounding box.
catrnav_wfs_get_buildings_bbox(x, srs, verbose = FALSE, count = NULL)
catrnav_wfs_get_buildings_bbox(x, srs, verbose = FALSE, count = NULL)
x |
See Details. It could be:
|
srs |
SRS/CRS to use on the query. See Details. |
verbose |
Logical, displays information. Useful for debugging, default
is |
count |
integer, indicating the maximum number of features to return.
The default value |
When x
is a numeric vector, make sure that the srs
matches the coordinate
values. Additionally, when the srs
correspond to a geographic reference system
(4326, 4258), the function queries the bounding box on
EPSG:25830 - ETRS89 / UTM zone 30N. The result is
provided always in the SRS provided in srs
.
When x
is a sf
object, the value srs
is ignored. The query is
performed using EPSG:25830 (ETRS89 / UTM zone 30N) and
the spatial object is projected back to the SRS of the initial object.
A sf
object.
CatastRo::catr_wfs_get_buildings_bbox()
downtown <- c(-1.646812, 42.814528, -1.638036, 42.820320) bu <- catrnav_wfs_get_buildings_bbox(downtown, srs = 4326) library(ggplot2) ggplot(bu) + geom_sf()
downtown <- c(-1.646812, 42.814528, -1.638036, 42.820320) bu <- catrnav_wfs_get_buildings_bbox(downtown, srs = 4326) library(ggplot2) ggplot(bu) + geom_sf()
Get the spatial data of cadastral parcels by bounding box.
catrnav_wfs_get_parcels_bbox(x, srs, verbose = FALSE, count = NULL)
catrnav_wfs_get_parcels_bbox(x, srs, verbose = FALSE, count = NULL)
x |
See Details. It could be:
|
srs |
SRS/CRS to use on the query. See Details. |
verbose |
Logical, displays information. Useful for debugging, default
is |
count |
integer, indicating the maximum number of features to return.
The default value |
When x
is a numeric vector, make sure that the srs
matches the coordinate
values. Additionally, when the srs
correspond to a geographic reference system
(4326, 4258), the function queries the bounding box on
EPSG:25830 - ETRS89 / UTM zone 30N. The result is
provided always in the SRS provided in srs
.
When x
is a sf
object, the value srs
is ignored. The query is
performed using EPSG:25830 (ETRS89 / UTM zone 30N) and
the spatial object is projected back to the SRS of the initial object.
A sf
object.
CatastRo::catr_wfs_get_parcels_bbox()
Other parcels:
catrnav_atom_get_parcels()
,
catrnav_atom_get_parcels_db_all()
downtown <- c(-1.646812, 42.814528, -1.638036, 42.820320) cp <- catrnav_wfs_get_parcels_bbox(downtown, srs = 4326) library(ggplot2) ggplot(cp) + geom_sf()
downtown <- c(-1.646812, 42.814528, -1.638036, 42.820320) cp <- catrnav_wfs_get_parcels_bbox(downtown, srs = 4326) library(ggplot2) ggplot(cp) + geom_sf()