Last chance! 50% off unlimited learning
Sale ends in
sf
polygonsDownloads worldwide coastlines
gisco_get_coastallines(
year = "2016",
epsg = "4326",
cache = TRUE,
update_cache = FALSE,
cache_dir = NULL,
verbose = FALSE,
resolution = "20"
)
Release year. One of "2006", "2010", "2013" or "2016"
projection of the map: 4-digit EPSG code. One of:
"4258": ETRS89
"4326": WGS84
"3035": ETRS89 / ETRS-LAEA
"3857": Pseudo-Mercator
A logical whether to do caching. Default is TRUE
. See
About caching.
A logical whether to update cache. Default is FALSE
.
When set to TRUE
it would force a fresh download of the source
.geojson file.
A path to a cache directory. See About caching.
Logical, displays information. Useful for debugging,
default is FALSE
.
Resolution of the geospatial data. One of
"60": 1:60million
"20": 1:20million
"10": 1:10million
"03": 1:3million
"01": 1:1million
A sf
POLYGON
object.
You can set your cache_dir
with gisco_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.
For a complete list of files available check gisco_db.
Other political:
gisco_bulk_download()
,
gisco_get_countries()
,
gisco_get_lau()
,
gisco_get_nuts()
,
gisco_get_postalcodes()
,
gisco_get_units()
,
gisco_get_urban_audit()
# NOT RUN {
coast <- gisco_get_coastallines()
library(ggplot2)
ggplot(coast) +
geom_sf(color = "#1278AB", fill = "#FDFBEA") +
# Zoom on Caribe
coord_sf(
xlim = c(-99, -49),
ylim = c(4, 30)
) +
theme_minimal() +
theme(panel.background = element_rect(fill = "#C7E7FB", color = "black"))
# }
Run the code above in your browser using DataLab