esp_get_grid_EEA {mapSpain} | R Documentation |
Get sf
POLYGON
of the national geographic grids from EEA
Description
Loads a sf
POLYGON
with the geographic grids of Spain as
provided by the European Environment Agency (EEA).
Usage
esp_get_grid_EEA(
resolution = 100,
type = "main",
update_cache = FALSE,
cache_dir = NULL,
verbose = FALSE
)
Arguments
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 |
Value
A sf
POLYGON
.
About caching
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.
Source
See Also
Other grids:
esp_get_grid_BDN()
,
esp_get_grid_ESDAC()
,
esp_get_grid_MTN()
Examples
## Not run:
grid <- esp_get_grid_EEA(type = "main", resolution = 100)
grid_can <- esp_get_grid_EEA(type = "canary", resolution = 100)
esp <- esp_get_country(moveCAN = FALSE)
library(ggplot2)
ggplot(grid) +
geom_sf() +
geom_sf(data = grid_can) +
geom_sf(data = esp, fill = NA) +
theme_light() +
labs(title = "EEA Grid for Spain")
## End(Not run)