Skip to contents

Downloads the Global Self-consistent, Hierarchical, High-resolution Geography (GSHHG) shoreline v2.3.7 (about 150 MB, once) and unzips the land polygons (level 1) at the chosen resolution. The result is the land layer of filter_layers() for the at_sea test. Any other land polygon file (e.g. OpenStreetMap land polygons) works too.

Usage

download_shoreline(
  path,
  resolution = c("h", "f", "i", "l", "c"),
  urls = c("https://www.soest.hawaii.edu/pwessel/gshhg/gshhg-shp-2.3.7.zip",
    "https://www.ngdc.noaa.gov/mgg/shorelines/data/gshhg/latest/gshhg-shp-2.3.7.zip")
)

Arguments

path

Folder for the download (re-used next time).

resolution

"h" high (~200 m, default), "f" full, "i" intermediate, "l" low or "c" crude.

urls

Download addresses tried in turn.

Value

The path of the land-polygon shapefile.

References

Wessel, P., Smith, W.H.F. (1996) A global, self-consistent, hierarchical, high-resolution shoreline database. Journal of Geophysical Research 101, 8741-8743.

Examples

if (FALSE) { # \dontrun{
land <- download_shoreline("data/coast")
lay <- filter_layers(land = land)
} # }