Skip to contents

Returns a base map. This map is returned as a ggplot2 object that more complex maps can be built on top of. It provides land, bathymetry, and, optionally, a variety of common layers including the NMFS management areas, 3 NMI buffer #' regions,and Critical Habitat and No Transit zones for ESA-listed species (these layers were gathered from https://www.fisheries.noaa.gov/resource/map/national-esa-critical-habitat-mapper by Abigail McCarthy in 2024) . These basemaps are intended for the Bering Sea and Gulf of Alaska. This layer will be slightly larger than the extent of plot_limits_data; users can use plot_expansion parameter to fine-tune the extent.

Usage

get_basemap_layers(
  plot_limits_data,
  bathy = TRUE,
  bathy_max_plot_depth = 1000,
  contours = NULL,
  contour_linescale = TRUE,
  management_regions = NULL,
  alaska_3nmi_buffer = NULL,
  land_fill_color = "#616161",
  land_outline_color = "black",
  plot_expansion = 0.05,
  SSL_critical_habitat = NULL,
  SSL_no_transit = NULL,
  humpback_critical_habitat = NULL,
  NPRW_critical_habitat = NULL,
  sea_otter_critical_habitat = NULL,
  CI_beluga_critical_habitat = NULL,
  walrus_protection_area = NULL,
  walrus_no_transit = NULL,
  NWR_Afognak_Semidi_boundaries = NULL,
  ringed_seal_critical_habitat = NULL,
  bearded_seal_critical_habitat = NULL
)

Arguments

plot_limits_data

A sf spatial dataframe; this is required and used to define the base map extent and projection.

bathy

By default, a bathymetric baselayer based on the GEBCO (https://www.gebco.net/) gridded bathymetric dataset is included in the basemap; If FALSE, bathymetric baselayer will not be included

bathy_max_plot_depth

The maximum depth you want to emphasize in the bathymetric color scale (default to 1000 m); this helps to focus the contrast at shallower depths and not emphasize especially deep areas off of the shelf break.

contours

Provide contour lines at requested depths. Specify depths as positive numeric values, i.e. c(200,100,50)

contour_linescale

Make each contour line a different type (solid, dashed, etc). Default is true. Note that the plot does not include the values in a legend, because MACE plots are already busy enough and we typically denote the values in captions. Default is TRUE.

management_regions

If TRUE, will add NMFS management regions to basemap

alaska_3nmi_buffer

If TRUE, will add the ADFG 3 nmi management buffer to basemap

land_fill_color

If you'd like a different fill color on landmasses, specify as required by ggplot2.

land_outline_color

If you'd like a different outline color on landmasses, specify as required by ggplot2.

plot_expansion

This controls the amount of buffer around the basemap (default is 5% (0.05) around the extent of the data; set from 0-1).

SSL_critical_habitat

If TRUE, will add Steller Sea Lion critical habitat buffers to basemap

SSL_no_transit

If TRUE, will add Steller Sea Lion no transit zones to basemap

humpback_critical_habitat

If TRUE, will add the Humpack whale DPS critical habitat to basemap

NPRW_critical_habitat

If TRUE, will add the North Pacific Right Whale critical habitat to basemap

sea_otter_critical_habitat

If TRUE, will add Sea Otter critical habitat to basemap

CI_beluga_critical_habitat

If TRUE, will add Cook Inlet Beluga critical habitat to basemap

walrus_protection_area

If TRUE, will add Pacific Walrus protection area to basemap

walrus_no_transit

If TRUE, will add Round Island Pacific Walrus no transit area to basemap

NWR_Afognak_Semidi_boundaries

If TRUE, will add the National Wildlife Refuge Afognak and Semidi boundaries to no transit area to basemap

ringed_seal_critical_habitat

If TRUE, will add Ringed Seal critical habitat to basemap

bearded_seal_critical_habitat

If TRUE, will add Bearded Seal critical habitat to basemap

Value

A list of class ggplot containing information required for plotting a basemap.

Author

Mike Levine

Examples

if (FALSE) { # \dontrun{
library(ggplot2)
library(sf)
library(MACEReports)

dat <- data.frame(
  "x" = c(-152.2, -150.3, -159.4),
  "y" = c(55.2, 55.8, 55.6),
  "z" = c(7500, 40000, 28000),
  "species" = c("a", "a", "b")
)

# create an sf dataframe
dat <- sf::st_as_sf(dat, coords = c("x", "y"), crs = 4326)

# convert CRS to a reasonable projection
dat <- sf::st_transform(dat, crs = "EPSG:3338")

# return the basemap as a ggplot layer
mace_basemap <- get_basemap_layers(plot_limits_data = dat)

# note that this basemap will replace the usual call to ggplot() as the start of your plot:
mace_basemap +
  geom_sf(data = dat, aes(color = species))

# You can add other commonly used MACE layers to the basemap
mace_basemap <- get_basemap_layers(plot_limits_data = dat,
management_regions = TRUE)
mace_basemap

mace_basemap <- get_basemap_layers(plot_limits_data = dat,
alaska_3nmi_buffer = TRUE)
mace_basemap

mace_basemap <- get_basemap_layers(plot_limits_data = dat,
SSL_critical_habitat = TRUE)
mace_basemap

mace_basemap <- get_basemap_layers(plot_limits_data = dat,
bathy = FALSE,
contours = c(200, 100, 50))
mace_basemap
} # }