knitr::opts_chunk$set(echo = TRUE, message = FALSE, warning = FALSE)
library(dplyr) library(ggplot2) library(RColorBrewer) library(sf) library(rgdal) library(magrittr) devtools::load_all(".") theme_set(theme_bw()) cols <- paste0(c(RColorBrewer::brewer.pal(8L, "Set1"))) dir = "D:/GitHub/pbs-assess/gfsynopsis-old/report/data-cache/"
First, bring in MPA network shapefile (created from geodatabase file received from Katie Gale Apr 15, 2020).
``` {r nsb_mpa, results = FALSE} closed <- sf::st_read(dsn="data/NSB_MPA", layer = "NSB_MPA") %>% select(-OBJECTID) # remove extra field added by ArcGIS in shapefile export names(closed) <- c(names(read_sf("D:/MPA/draft MPA network Apr15 2020/MPA.gdb", layer = "Spatial_J1_20200403_Full_Attributes"))[1:73], "geometry") # revert truncated names
coastUTM <- sf::st_read(dsn = "data/baselayer_shps", layer = "BC_coast_UTM9") g <- ggplot() + geom_sf(data = coastUTM, aes(fill = "BC coast")) g + geom_sf(data = closed, aes(fill = "MPA network")) + coord_sf(xlim = c(-134.5, -123), ylim = c(48, 55), crs = sf::st_crs(4326)) + scale_fill_manual(values = c("gray80", paste0(cols[6], "60")), name= "", labels=c("BC coast", "Proposed MPA network")) + ggtitle("Proposed MPA Network Zones")
Only some of the zones would restrict commercial bottom trawl fishery activity, and potentially bottom trawl survey activity. Filtering for just those zones: ```r trawl <- closed_areas(closed, fishery = "trawl") g + geom_sf(data = closed, aes(fill = "Proposed MPA network")) + geom_sf(data = trawl, aes(fill = "Proposed bottom trawl \nrestricted zones")) + coord_sf(xlim = c(-134.5, -122), ylim = c(48, 55), crs = sf::st_crs(4326)) + scale_colour_manual("black") + scale_fill_manual(values = c("gray80", cols[6], paste0(cols[6], "20")), breaks = c("Proposed MPA network", "Proposed bottom trawl \nrestricted zones"), name= "") + ggtitle("Proposed MPA Network Commercial \nTrawl Restricted Zones") + theme(plot.title = element_text(hjust = 0.5))
Similarly for longline commercial (and potentially, survey) activity restrictions:
ll <- closed_areas(fishery = "ll") g + geom_sf(data = closed, aes(fill = "Proposed MPA network")) + geom_sf(data = ll, aes(fill = "Proposed longline restricted zones")) + coord_sf(xlim = c(-134.5, -122), ylim = c(48, 55)) + scale_colour_manual("black") + scale_fill_manual(values = c("gray80", cols[6], paste0(cols[6], "20")), breaks = c("Proposed MPA network", "Proposed longline restricted zones"), name= "") + ggtitle("Proposed MPA Network Commercial \nLongline Restricted Zones") + theme(plot.title = element_text(hjust = 0.5))
Bring in synoptic trawl survey boundaries:
syn <- "data/SynopticTrawlSurveyBoundaries" hs <- sf::st_read(dsn=syn, layer = "HS_BLOB") qcs <- sf::st_read(dsn=syn, layer = "QCS_BLOB") wchg <- sf::st_read(dsn=syn, layer = "WCHG_BLOB") wcvi <- sf::st_read(dsn=syn, layer = "WCVI_BLOB") g + geom_sf(data = trawl, aes(fill = "Proposed bottom trawl restricted zones")) + geom_sf(data = hs, aes(fill = "Hecate Strait survey")) + geom_sf(data = qcs, aes(fill = "Queen Charlotte Sound survey")) + geom_sf(data = wchg, aes(fill = "West Coast Haida Gwaii survey")) + geom_sf(data = wcvi, aes(fill = "West Coast Vancouver Island survey")) + coord_sf(xlim = c(-134.5, -122), ylim = c(48, 55), crs = sf::st_crs(4326)) + scale_colour_manual("black") + scale_fill_manual(values = c("gray80", paste0(cols[2], "60"), paste0(cols[6], "60"), paste0(cols[3], "60"), paste0(cols[1], "60"), paste0(cols[4], "60")), breaks = c("Proposed bottom trawl restricted zones", "Hecate Strait survey", "Queen Charlotte Sound survey", "West Coast Haida Gwaii survey", "West Coast Vancouver Island survey"), name= "") + ggtitle("Synoptic Trawl Survey Boundaries with \nproposed MPA network trawl restricted Zones")
syn <- "data/SynSurveyShps" hs <- sf::st_read(dsn=syn, layer = "Syn_HS_active") qcs <- sf::st_read(dsn=syn, layer = "Syn_QCS_active") wchg <- sf::st_read(dsn=syn, layer = "Syn_WCHG_active") wcvi <- sf::st_read(dsn=syn, layer = "Syn_WCVI_active") g + geom_sf(data = trawl, aes(fill = "Proposed bottom trawl restricted zones")) + geom_sf(data = hs, aes(fill = "Hecate Strait survey")) + geom_sf(data = qcs, aes(fill = "Queen Charlotte Sound survey")) + geom_sf(data = wchg, aes(fill = "West Coast Haida Gwaii survey")) + geom_sf(data = wcvi, aes(fill = "West Coast Vancouver Island survey")) + coord_sf(xlim = c(-134.5, -122), ylim = c(48, 55), crs = sf::st_crs(4326)) + scale_colour_manual("black") + scale_fill_manual(values = c("gray80", paste0(cols[2], "60"), paste0(cols[6], "60"), paste0(cols[3], "60"), paste0(cols[1], "60"), paste0(cols[4], "60")), breaks = c("Proposed bottom trawl restricted zones", "Hecate Strait survey", "Queen Charlotte Sound survey", "West Coast Haida Gwaii survey", "West Coast Vancouver Island survey"), name= "")
And HBLL outside boundaries:
hbll <- "data/HBLL_boundaries" hbll_out_n <- sf::st_read(dsn=hbll, layer = "PHMA_N_boundaries") hbll_out_s <- sf::st_read(dsn=hbll, layer = "PHMA_S_boundaries") g + geom_sf(data = ll, aes(fill = "Proposed longline restricted zones")) + geom_sf(data = hbll_out_n, aes(fill = "HBLL outside north")) + geom_sf(data = hbll_out_s, aes(fill = "HBLL outside south")) + coord_sf(xlim = c(-134.5, -122), ylim = c(48, 55)) + scale_colour_manual("black") + scale_fill_manual(values = c("gray80", paste0(cols[5], "60"), paste0(cols[7], "60"), paste0(cols[6], "60")), breaks = c("Proposed longline restricted zones", "HBLL outside north", "HBLL outside south"), name= "") + ggtitle("Hard Bottom Longline Survey Boundaries with \nproposed MPA network longline restricted zones") + theme(plot.title = element_text(hjust = 0.5))
\clearpage
Read in the survey data for an example species, yelloweye rockfish. survey_sets()
imports data for a given species from a cached .rds file if it exists, otherwise could run gfdata::get_survey_sets() for any gf species when connected to DFO databases))
survey_sets <- import_survey_sets("yelloweye rockfish", ssid = c(1, 3, 4, 16, 22, 36), dir = dir) g + geom_point(data = survey_sets, aes(x = longitude, y = latitude), size = 0.1, pch = 4, color = "dark blue") + coord_sf(xlim = c(-134.5, -122), ylim = c(48, 55)) + scale_fill_manual(values = c("gray80", "dark blue"), name = "") + ggtitle("Yelloweye Synoptic Survey Sets")
Now remove bottom trawl closed areas from the synoptic survey yelloweye data (using Hecate Strait survey as an example). Dark blue points showing through are those that could be removed from the data set by the MPA restrictions for the commercial bottom trawl fishery.
data_exclude <- clip_by_mpa(survey_sets, ssid = 3) plot_survey_pts(data = survey_sets, ssid = 1) + geom_point(data = data_exclude, aes(y = latitude, x = longitude), size = 0.5, pch = 4, color = "light blue") + coord_sf(xlim = c(-134.5, -122), ylim = c(48, 55)) + scale_fill_manual(values = c("gray80", "dark blue"), name = "") + ggtitle("Yelloweye Synoptic Survey Sets - \nReduced by MPA Network Restrictions") + theme(plot.title = element_text(hjust = 0.5))
ssids <- c(1, 3, 4, 16, 22, 36) k <- list() for(i in ssids){ d <- survey_sets %>% filter(survey_series_id == 1) k[i] <- d }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.