Skip to contents

Downloads worldwide coastlines.

Usage

gisco_get_coastal_lines(
  year = 2016,
  epsg = 4326,
  cache = TRUE,
  update_cache = FALSE,
  cache_dir = NULL,
  verbose = FALSE,
  resolution = 20,
  ext = "gpkg"
)

Arguments

year

A character string or numeric value with the release year of the file. One of "2016", "2013", "2010", "2006" .

epsg

A character string or numeric value with the map projection as a 4-digit EPSG code. One of:

cache

A logical value indicating whether to cache results. Default is TRUE. See Caching strategies section in gisco_set_cache_dir().

update_cache

A logical value indicating whether to refresh the cached file. Default is FALSE. When set to TRUE, it forces a new download.

cache_dir

A character string with a path to a cache directory. See Caching strategies section in gisco_set_cache_dir().

verbose

A logical value. If TRUE displays informational messages.

resolution

A character string or numeric value with the geospatial data resolution. One of:

  • "60": 1:60 million.

  • "20": 1:20 million.

  • "10": 1:10 million.

  • "03": 1:3 million.

  • "01": 1:1 million.

ext

A character value with the extension of the file (default "gpkg"). One of "shp", "gpkg", "geojson" .

Value

A sf object.

Note

Check the download and usage provisions in gisco_attributions().

See also

gisco_coastal_lines.

See gisco_bulk_download() to perform a bulk download of datasets.

Other statistical units datasets: gisco_get_census(), gisco_get_lau(), gisco_get_nuts(), gisco_get_urban_audit()

Examples

coast <- gisco_get_coastal_lines()

library(ggplot2)

ggplot(coast) +
  geom_sf(color = "#1278AB", fill = "#FDFBEA") +
  # Zoom on the Mediterranean Sea.
  coord_sf(
    xlim = c(-4, 35),
    ylim = c(31, 45)
  ) +
  theme_minimal() +
  theme(
    panel.background = element_rect(fill = "#C7E7FB", color = NA),
    panel.border = element_rect(colour = "black", fill = NA)
  )