get_base_layers_v3: Function to get base layers for bottom trawl and longline...

View source: R/get_base_layers_v3.R

get_base_layers_v3R Documentation

Function to get base layers for bottom trawl and longline survey regions, bathymetry, and land

Description

This function retrieves layers that are commonly used for mapping and spatial analysis of AFSC bottom trawl survey and longline survey data.

Usage

get_base_layers_v3(
  select.region,
  set.crs = "EPSG:4269",
  use.survey.bathymetry = TRUE,
  include.corners = NULL,
  split.land.at.180 = TRUE,
  fix.invalid.geom = TRUE,
  high.resolution.coast = FALSE
)

Arguments

select.region

Character vector indicating which region to retrieve. Bottom trawl survey options: ebs or bs.all, sebs or bs.south, nbs or bs.north, ecs, ebs.ecs, ai, ai.west, ai.central, ai.east, goa, goa.west, goa.east, ebs.slope, bssa1, bssa2, bssa3, bssa4, bssa5, bssa6. Longline survey options: ll.ebs, ll.bssa1, ll.bssa2, ll.bssa3, ll.bssa4, ll.bssa5, ll.ai, ll.ai.west, ll.ai.central, ll.goa, ll.goa.west, ll.goa.central, ll.goa.east

set.crs

Which coordinate reference system should be used? If 'auto', Alaska Albers Equal Area (EPSG:3338) will be used.

use.survey.bathymetry

Should survey bathymetry be used?

include.corners

Logical. Should corner stations be returned in the survey grid? Only for the EBS.

split.land.at.180

Logical. If set.crs is a geographic coordinate system, should the land polygon be split at 180 degrees to prevent polygons from wrapping around the world? Default = TRUE.

fix.invalid.geom

Should invalid geometries be corrected using st_make_valid() and st_wrap_dateline()?

high.resolution.coast

Should the State of Alaska polygon be a high resolution Alaska Department of Natural Resources 1:63360 scale polygon that includes smaller islands and a more detailed coastline? The higher resolution polygon (high.resolution.coast = TRUE) takes longer to load/plot and is recommended for spatial operations performed at high resolution (e.g., masking high resolution rasters). The lower resolution polygon (high.resolution.coast = FALSE) is recommended for general mapping and visualization purposes. Default = FALSE.

Value

A list containing sf objects land, bathymetry, survey area boundary, survey strata, survey grid (or survey stations for the longline survey), a data frame of feature labels (for the EBS shelf bottom trawl survey), coordinate reference system, plot boundaryies, axis label breaks, and graticule.

Examples

## Not run: 
library(akgfmaps)

# EBS bottom trawl survey layers in Alaska Albers Equal Area projection (EPSG:3338)
sebs <- get_base_layers_v3(select.region = "sebs",
                           set.crs = "EPSG:3338")

ggplot() +
  geom_sf(data = sebs$akland) +
  geom_sf(data = sebs$survey.strata,
          fill = NA,
          mapping = aes(color = "Survey strata")) +
  geom_sf(data = sebs$survey.grid,
          fill = NA,
          mapping = aes(color = "Station grid")) +
  geom_sf(data = sebs$survey.area,
          fill = NA,
          mapping = aes(color = "Survey area")) +
  geom_sf(data = sebs$graticule, alpha = 0.3, linewidth = 0.5) +
  scale_x_continuous(limits = sebs$plot.boundary$x,
                     breaks = sebs$lon.breaks) +
  scale_y_continuous(limits = sebs$plot.boundary$y,
                     breaks = sebs$lat.breaks) +
  theme_bw()

# EBS bottom trawl survey layers in NAD83 (EPSG:4269) with corner stations and high resolution
# coastline. High resolution coastline takes longer to load and plot but is recommended when land
# polygons are used for spatial analysis

sebs_corners <- get_base_layers_v3(select.region = "sebs",
                                   set.crs = "EPSG:4269",
                                   include.corners = TRUE,
                                   high.resolution.coast = TRUE)

ggplot() +
  geom_sf(data = sebs_corners$akland) +
  geom_sf(data = sebs_corners$survey.strata,
          fill = NA,
          mapping = aes(color = "Survey strata")) +
  geom_sf(data = sebs_corners$survey.grid,
          fill = NA,
          mapping = aes(color = "Station grid")) +
  geom_sf(data = sebs_corners$survey.area,
          fill = NA,
          mapping = aes(color = "Survey area")) +
  geom_sf(data = sebs_corners$graticule, alpha = 0.3, linewidth = 0.5) +
  scale_x_continuous(limits = sebs_corners$plot.boundary$x,
                     breaks = sebs_corners$lon.breaks) +
  scale_y_continuous(limits = sebs_corners$plot.boundary$y,
                     breaks = sebs_corners$lat.breaks) +
  theme_bw()

# EBS slope, Aleutian Islands, and Gulf of Alaska surveys have subarea options
ai_west <- get_base_layers_v3(select.region = "ai.west",
                           set.crs = "EPSG:3338")

ggplot() +
  geom_sf(data = ai_west$akland) +
  geom_sf(data = ai_west$survey.strata,
          fill = NA,
          mapping = aes(color = "Survey strata")) +
  geom_sf(data = ai_west$survey.grid,
          fill = NA,
          mapping = aes(color = "Station grid")) +
  geom_sf(data = ai_west$survey.area,
          fill = NA,
          mapping = aes(color = "Survey area")) +
  geom_sf(data = ai_west$graticule, alpha = 0.3, linewidth = 0.5) +
  scale_x_continuous(limits = ai_west$plot.boundary$x,
                     breaks = ai_west$lon.breaks) +
  scale_y_continuous(limits = ai_west$plot.boundary$y,
                     breaks = ai_west$lat.breaks) +
  theme_bw()
## End(Not run)

afsc-gap-products/akgfmaps documentation built on April 14, 2025, 7:13 p.m.