View source: R/esp_get_grid_BDN.R
| esp_get_grid_BDN | R Documentation |
sf POLYGON with the national geographic grids from BDNLoads a sf POLYGON with the geographic grids of Spain as
provided on the Banco de Datos de la Naturaleza (Nature Data Bank), by the
Ministry of Environment (MITECO):
esp_get_grid_BDN() extracts country-wide grids with resolutions
5x5 or 10x10 kms.
esp_get_grid_BDN_ccaa() extracts grids by Autonomous Community with
resolution 1x1 km.
esp_get_grid_BDN(
resolution = 10,
type = "main",
update_cache = FALSE,
cache_dir = NULL,
verbose = FALSE
)
esp_get_grid_BDN_ccaa(
ccaa,
update_cache = FALSE,
cache_dir = NULL,
verbose = FALSE
)
resolution |
Resolution of the grid in kms. Could be |
type |
The scope of the grid. It could be mainland Spain ( |
update_cache |
A logical whether to update cache. Default is |
cache_dir |
A path to a cache directory. See About caching. |
verbose |
Logical, displays information. Useful for debugging,
default is |
ccaa |
A vector of names and/or codes for autonomous communities.
See Details on |
A sf POLYGON.
You can set your cache_dir with esp_set_cache_dir().
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 .geojson file by any other method and save it on your
cache_dir. Use the option verbose = TRUE for debugging the API query.
BDN data via a custom CDN (see https://github.com/rOpenSpain/mapSpain/tree/sianedata/MTN).
See original metadata and source on https://www.miteco.gob.es/es/biodiversidad/servicios/banco-datos-naturaleza/informacion-disponible/bdn-cart-aux-descargas-ccaa.html
esp_get_ccaa()
Other grids:
esp_get_grid_EEA(),
esp_get_grid_ESDAC(),
esp_get_grid_MTN()
grid <- esp_get_grid_BDN(resolution = "10", type = "main")
library(ggplot2)
ggplot(grid) +
geom_sf() +
theme_light() +
labs(title = "BDN Grid for Spain")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.