Skip to content

Commit

Permalink
Add 2019 EBS/NBS
Browse files Browse the repository at this point in the history
  • Loading branch information
sean-rohan-NOAA committed Dec 19, 2024
1 parent 68bef27 commit 6b72a58
Show file tree
Hide file tree
Showing 24 changed files with 38 additions and 79 deletions.
108 changes: 35 additions & 73 deletions analysis/akgfmaps4/make_bt_gpkg.R
Original file line number Diff line number Diff line change
Expand Up @@ -89,75 +89,36 @@ goa_station_grid_2025 |>
append = TRUE,
delete_dsn = FALSE)

# EBS 1993 design ----
# ebs_survey_area_1993 <-
# sf::st_read(here::here("inst", "extdata", "ebs_shelf_strata_1987.shp"))
#
# ebs_survey_area_1993$AREA_KM2 <- sf::st_area(ebs_survey_area_1993)/1e6
#
# |>
# dplyr::group_by(AREA_TYPE = "REGION",
# SURVEY_NAME = "Eastern Bering Crab/Groundfish Bottom Trawl Survey",
# DESIGN_YEAR = 1982,
# SURVEY_DEFINITION_ID = 98,
# AREA_ID = 99901) |>
# dplyr::summarise(AREA_M2 = sum(AREA),
# do_union = TRUE)
#
# ebs_survey_area_1982 |>
# sf::st_write(dsn = here::here("inst", "extdata", "afsc_bottom_trawl_surveys.gpkg"),
# layer = "survey_area",
# append = TRUE,
# delete_dsn = FALSE)
#
# sf::st_read(here::here("inst", "extdata", "ebs_shelf_strata_1982.shp")) |>
# sf::st_transform(crs = "EPSG:3338") |>
# dplyr::mutate(AREA_M2 = AREA,
# AREA_ID = EBS_STRATU,
# AREA_TYPE = "STRATUM",
# DESIGN_YEAR = 1982,
# SURVEY_DEFINITION_ID = 98) |>
# dplyr::select(AREA_TYPE, SURVEY_DEFINITION_ID, DESIGN_YEAR, AREA_ID, AREA_M2) |>
# sf::st_write(dsn = here::here("inst", "extdata", "afsc_bottom_trawl_surveys.gpkg"),
# layer = "survey_strata",
# append = TRUE,
# delete_dsn = FALSE)
#
# sf::st_read(here::here("inst", "extdata", "ebs_grid_1982.shp")) |>
# sf::st_transform(crs = "EPSG:3338") |>
# dplyr::filter(STATION_ID %in% akgfmaps::get_survey_stations(select.region = "sebs",
# include.corners = FALSE)) |>
# dplyr::filter(!(STATION_ID %in% c(paste0("S-", 27:31),
# paste0("T-", 25:30),
# paste0("U-", 25:29),
# paste0("V-", 25:28)))
# ) |>
# dplyr::mutate(AREA_TYPE = "STATION",
# SURVEY_DEFINITION_ID = 98,
# DESIGN_YEAR = 1982) |>
# dplyr::select(AREA_TYPE,
# SURVEY_DEFINITION_ID,
# DESIGN_YEAR,
# STATION = STATION_ID,
# AREA_M2 = AREA)
#
# ggplot() +
# geom_sf(data = test) +
# geom_sf_text(data = sf::st_centroid(test),
# mapping = aes(label = STATION_ID))
#
# ebs_survey_area_1982
# sf::st_transform(crs = "EPSG:3338") |>
# dplyr::mutate(AREA_M2 = AREA,
# AREA_ID = EBS_STRATU,
# AREA_TYPE = "STRATUM",
# DESIGN_YEAR = 1982,
# SURVEY_DEFINITION_ID = 98) |>
# dplyr::select(AREA_TYPE, SURVEY_DEFINITION_ID, DESIGN_YEAR, AREA_ID, AREA_M2) |>
# sf::st_write(dsn = here::here("inst", "extdata", "afsc_bottom_trawl_surveys.gpkg"),
# layer = "survey_strata",
# append = TRUE,
# delete_dsn = FALSE)
# EBS and NBS 2010 ----

# EBS and NBS 2019 ----
ebs_strata_2019 <- sf::st_read(dsn = here::here("inst", "extdata", "EBS_NBS_2019.shp")) |>
sf::st_transform(crs = "EPSG:3338") |>
dplyr::mutate(SURVEY_NAME = dplyr::if_else(STRATUM %in% c(70, 71, 82), "Northern Bering Sea Crab/Groundfish Survey - Eastern Bering Sea Shelf Survey Extension", "Eastern Bering Crab/Groundfish Bottom Trawl Survey"),
SURVEY_DEFINITION_ID = dplyr::if_else(STRATUM %in% c(70, 71, 82), 143, 98),
AREA_ID = dplyr::if_else(STRATUM %in% c(70, 71, 82), 99902, 99900),
AREA_TYPE = "REGION",
DESIGN_YEAR = 2019) |>
dplyr::group_by(AREA_TYPE, SURVEY_NAME, SURVEY_DEFINITION_ID, DESIGN_YEAR, AREA_ID) |>
dplyr::summarise(AREA_M2 = sum(AREA_KM2*1e6),
do_union = TRUE) |>
sf::st_write(dsn = here::here("inst", "extdata", "afsc_bottom_trawl_surveys.gpkg"),
layer = "survey_area",
append = TRUE,
delete_dsn = FALSE)

sf::st_read(dsn = here::here("inst", "extdata", "EBS_NBS_2019.shp")) |>
sf::st_transform(crs = "EPSG:3338") |>
dplyr::mutate(AREA_M2 = AREA_KM2 * 1e6,
AREA_ID = STRATUM,
AREA_TYPE = "STRATUM",
DESIGN_YEAR = 2019,
SURVEY_DEFINITION_ID = dplyr::if_else(STRATUM %in% c(70, 71, 82), 143, 98)) |>
dplyr::select(AREA_TYPE, SURVEY_DEFINITION_ID, DESIGN_YEAR, AREA_ID, AREA_M2) |>
sf::st_write(dsn = here::here("inst", "extdata", "afsc_bottom_trawl_surveys.gpkg"),
layer = "survey_strata",
append = TRUE,
delete_dsn = FALSE)

# Eastern Bering Sea and Northern Bering Sea 2022 calculations ----
ebs_layers <- akgfmaps:::get_base_layers_v3(select.region = "ebs",
Expand Down Expand Up @@ -195,7 +156,7 @@ ebs_layers$survey.grid |>
SURVEY_DEFINITION_ID = dplyr::if_else(STATIONID %in% akgfmaps::get_survey_stations(select.region = "nbs"), 143, 98),
AREA_TYPE = "STATION",
DESIGN_YEAR = dplyr::if_else(STATIONID %in% akgfmaps::get_survey_stations(select.region = "nbs"), 2010, 2024)) |>
dplyr::select(AREA_TYPE, SURVEY_DEFINITION_ID, DESIGN_YEAR, GRID_ID, STATION = STATIONID, AREA_M2) |>
dplyr::select(AREA_TYPE, SURVEY_DEFINITION_ID, DESIGN_YEAR, STATION = STATIONID, AREA_M2) |>
sf::st_write(dsn = here::here("inst", "extdata", "afsc_bottom_trawl_surveys.gpkg"),
layer = "survey_grid",
append = TRUE,
Expand Down Expand Up @@ -283,14 +244,15 @@ sf::st_read(system.file("extdata", "ai_grid.shp", package = "akgfmaps")) |>
sf::st_read(system.file("extdata", "ai_grid.shp", package = "akgfmaps")) |>
dplyr::filter(STRATUM > 0) |>
sf::st_transform(crs = "EPSG:3338") |>
dplyr::select(STRATUM) |>
dplyr::group_by(STRATUM) |>
dplyr::select(AREA_ID = STRATUM) |>
dplyr::group_by(AREA_ID) |>
dplyr::summarise(do_union = TRUE) |>
akgfmaps:::fix_geometry() |>
dplyr::mutate(AREA_M2 = as.numeric(sf::st_area(geometry)),
DESIGN_YEAR = 1980,
AREA_TYPE = "STRATUM",
SURVEY_DEFINITION_ID = 52) |>
SURVEY_DEFINITION_ID = 52,
AREA_ID) |>
sf::st_write(dsn = here::here("inst", "extdata", "afsc_bottom_trawl_surveys.gpkg"),
layer = "survey_strata",
append = TRUE,
Expand Down
File renamed without changes.
Binary file added inst/extdata/EBS_NBS_2019.dbf
Binary file not shown.
1 change: 1 addition & 0 deletions inst/extdata/EBS_NBS_2019.prj
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]
Binary file added inst/extdata/EBS_NBS_2019.sbn
Binary file not shown.
Binary file added inst/extdata/EBS_NBS_2019.sbx
Binary file not shown.
Binary file added inst/extdata/EBS_NBS_2019.shp
Binary file not shown.
2 changes: 2 additions & 0 deletions inst/extdata/EBS_NBS_2019.shp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata xml:lang="en"><Esri><CreaDate>20210514</CreaDate><CreaTime>09140900</CreaTime><ArcGISFormat>1.0</ArcGISFormat><SyncOnce>FALSE</SyncOnce><DataProperties><itemProps><itemName Sync="TRUE">EBSNBS2019_HD</itemName><imsContentType Sync="TRUE">002</imsContentType><itemSize Sync="TRUE">0.000</itemSize><itemLocation><linkage Sync="TRUE">file://\\AKCSD1184-DN18\C$\Users\dan.nichol\Work\Data\EBS_SURVEY_DESIGN\SURVEY_STRATA\STRATA_AREA_SHAPE_FILES_2019\EBSNBS2019_HD.shp</linkage><protocol Sync="TRUE">Local Area Network</protocol></itemLocation></itemProps><coordRef><type Sync="TRUE">Projected</type><geogcsn Sync="TRUE">GCS_North_American_1983</geogcsn><csUnits Sync="TRUE">Linear Unit: Meter (1.000000)</csUnits><projcsn Sync="TRUE">NAD_1983_Alaska_Albers</projcsn><peXml Sync="TRUE">&lt;ProjectedCoordinateSystem xsi:type='typens:ProjectedCoordinateSystem' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xs='http://www.w3.org/2001/XMLSchema' xmlns:typens='http://www.esri.com/schemas/ArcGIS/10.7'&gt;&lt;WKT&gt;PROJCS[&amp;quot;NAD_1983_Alaska_Albers&amp;quot;,GEOGCS[&amp;quot;GCS_North_American_1983&amp;quot;,DATUM[&amp;quot;D_North_American_1983&amp;quot;,SPHEROID[&amp;quot;GRS_1980&amp;quot;,6378137.0,298.257222101]],PRIMEM[&amp;quot;Greenwich&amp;quot;,0.0],UNIT[&amp;quot;Degree&amp;quot;,0.0174532925199433]],PROJECTION[&amp;quot;Albers&amp;quot;],PARAMETER[&amp;quot;False_Easting&amp;quot;,0.0],PARAMETER[&amp;quot;False_Northing&amp;quot;,0.0],PARAMETER[&amp;quot;Central_Meridian&amp;quot;,-154.0],PARAMETER[&amp;quot;Standard_Parallel_1&amp;quot;,55.0],PARAMETER[&amp;quot;Standard_Parallel_2&amp;quot;,65.0],PARAMETER[&amp;quot;Latitude_Of_Origin&amp;quot;,50.0],UNIT[&amp;quot;Meter&amp;quot;,1.0],AUTHORITY[&amp;quot;EPSG&amp;quot;,3338]]&lt;/WKT&gt;&lt;XOrigin&gt;-13752200&lt;/XOrigin&gt;&lt;YOrigin&gt;-8948200&lt;/YOrigin&gt;&lt;XYScale&gt;327482121.21482342&lt;/XYScale&gt;&lt;ZOrigin&gt;-100000&lt;/ZOrigin&gt;&lt;ZScale&gt;10000&lt;/ZScale&gt;&lt;MOrigin&gt;-100000&lt;/MOrigin&gt;&lt;MScale&gt;10000&lt;/MScale&gt;&lt;XYTolerance&gt;0.001&lt;/XYTolerance&gt;&lt;ZTolerance&gt;0.001&lt;/ZTolerance&gt;&lt;MTolerance&gt;0.001&lt;/MTolerance&gt;&lt;HighPrecision&gt;true&lt;/HighPrecision&gt;&lt;WKID&gt;102006&lt;/WKID&gt;&lt;LatestWKID&gt;3338&lt;/LatestWKID&gt;&lt;/ProjectedCoordinateSystem&gt;</peXml></coordRef><lineage><Process ToolSource="c:\program files (x86)\arcgis\desktop10.7\ArcToolbox\Toolboxes\Data Management Tools.tbx\Merge" Date="20191209" Time="170955">Merge EBSHiDens7;NBS_strata_2019 C:\Users\dan.nichol\Work\Data\EBS_SURVEY_DESIGN\SURVEY_STRATA\STRATA_AREA_SHAPE_FILES_2019\EBSNBS2019_HD.shp "Id "Id" true true false 4 Long 0 0 ,First,#,EBSHiDens7,Id,-1,-1,NBS_strata_2019,Id,-1,-1;Shape_Leng "Shape_Leng" false true true 8 Double 0 0 ,First,#,EBSHiDens7,Shape_Length,-1,-1;Shape_Area "Shape_Area" false true true 8 Double 0 0 ,First,#,EBSHiDens7,Shape_Area,-1,-1;F_AREA "F_AREA" true true false 19 Double 0 0 ,First,#,NBS_strata_2019,F_AREA,-1,-1"</Process></lineage></DataProperties><SyncDate>20191209</SyncDate><SyncTime>17095300</SyncTime><ModDate>20191209</ModDate><ModTime>17095300</ModTime></Esri><dataIdInfo><envirDesc Sync="TRUE"> Version 6.2 (Build 9200) ; Esri ArcGIS 10.7.0.10450</envirDesc><dataLang><languageCode value="eng" Sync="TRUE"></languageCode><countryCode value="USA" Sync="TRUE"></countryCode></dataLang><idCitation><resTitle Sync="TRUE">EBSNBS2019_HD</resTitle><presForm><PresFormCd value="005" Sync="TRUE"></PresFormCd></presForm></idCitation><spatRpType><SpatRepTypCd value="001" Sync="TRUE"></SpatRepTypCd></spatRpType></dataIdInfo><mdLang><languageCode value="eng" Sync="TRUE"></languageCode><countryCode value="USA" Sync="TRUE"></countryCode></mdLang><mdChar><CharSetCd value="004" Sync="TRUE"></CharSetCd></mdChar><distInfo><distFormat><formatName Sync="TRUE">Shapefile</formatName></distFormat><distTranOps><transSize Sync="TRUE">0.000</transSize></distTranOps></distInfo><mdHrLv><ScopeCd value="005" Sync="TRUE"></ScopeCd></mdHrLv><mdHrLvName Sync="TRUE">dataset</mdHrLvName><refSysInfo><RefSystem><refSysID><identCode code="3338" Sync="TRUE"></identCode><idCodeSpace Sync="TRUE">EPSG</idCodeSpace><idVersion Sync="TRUE">6.12(9.3.0.0)</idVersion></refSysID></RefSystem></refSysInfo><spatRepInfo><VectSpatRep><geometObjs Name="EBSNBS2019_HD"><geoObjTyp><GeoObjTypCd value="002" Sync="TRUE"></GeoObjTypCd></geoObjTyp><geoObjCnt Sync="TRUE">0</geoObjCnt></geometObjs><topLvl><TopoLevCd value="001" Sync="TRUE"></TopoLevCd></topLvl></VectSpatRep></spatRepInfo><spdoinfo><ptvctinf><esriterm Name="EBSNBS2019_HD"><efeatyp Sync="TRUE">Simple</efeatyp><efeageom code="4" Sync="TRUE"></efeageom><esritopo Sync="TRUE">FALSE</esritopo><efeacnt Sync="TRUE">0</efeacnt><spindex Sync="TRUE">FALSE</spindex><linrefer Sync="TRUE">FALSE</linrefer></esriterm></ptvctinf></spdoinfo><eainfo><detailed Name="EBSNBS2019_HD"><enttyp><enttypl Sync="TRUE">EBSNBS2019_HD</enttypl><enttypt Sync="TRUE">Feature Class</enttypt><enttypc Sync="TRUE">0</enttypc></enttyp><attr><attrlabl Sync="TRUE">FID</attrlabl><attalias Sync="TRUE">FID</attalias><attrtype Sync="TRUE">OID</attrtype><attwidth Sync="TRUE">4</attwidth><atprecis Sync="TRUE">0</atprecis><attscale Sync="TRUE">0</attscale><attrdef Sync="TRUE">Internal feature number.</attrdef><attrdefs Sync="TRUE">Esri</attrdefs><attrdomv><udom Sync="TRUE">Sequential unique whole numbers that are automatically generated.</udom></attrdomv></attr><attr><attrlabl Sync="TRUE">Shape</attrlabl><attalias Sync="TRUE">Shape</attalias><attrtype Sync="TRUE">Geometry</attrtype><attwidth Sync="TRUE">0</attwidth><atprecis Sync="TRUE">0</atprecis><attscale Sync="TRUE">0</attscale><attrdef Sync="TRUE">Feature geometry.</attrdef><attrdefs Sync="TRUE">Esri</attrdefs><attrdomv><udom Sync="TRUE">Coordinates defining the features.</udom></attrdomv></attr><attr><attrlabl Sync="TRUE">Id</attrlabl><attalias Sync="TRUE">Id</attalias><attrtype Sync="TRUE">Integer</attrtype><attwidth Sync="TRUE">10</attwidth><atprecis Sync="TRUE">10</atprecis><attscale Sync="TRUE">0</attscale></attr><attr><attrlabl Sync="TRUE">Shape_Leng</attrlabl><attalias Sync="TRUE">Shape_Leng</attalias><attrtype Sync="TRUE">Double</attrtype><attwidth Sync="TRUE">19</attwidth><atprecis Sync="TRUE">0</atprecis><attscale Sync="TRUE">0</attscale></attr><attr><attrlabl Sync="TRUE">Shape_Area</attrlabl><attalias Sync="TRUE">Shape_Area</attalias><attrtype Sync="TRUE">Double</attrtype><attwidth Sync="TRUE">19</attwidth><atprecis Sync="TRUE">0</atprecis><attscale Sync="TRUE">0</attscale><attrdef Sync="TRUE">Area of feature in internal units squared.</attrdef><attrdefs Sync="TRUE">Esri</attrdefs><attrdomv><udom Sync="TRUE">Positive real numbers that are automatically generated.</udom></attrdomv></attr><attr><attrlabl Sync="TRUE">F_AREA</attrlabl><attalias Sync="TRUE">F_AREA</attalias><attrtype Sync="TRUE">Double</attrtype><attwidth Sync="TRUE">19</attwidth><atprecis Sync="TRUE">0</atprecis><attscale Sync="TRUE">0</attscale></attr></detailed></eainfo><mdDateSt Sync="TRUE">20191209</mdDateSt></metadata>
Binary file added inst/extdata/EBS_NBS_2019.shx
Binary file not shown.
Binary file modified inst/extdata/afsc_bottom_trawl_surveys.gpkg
Binary file not shown.
Binary file removed inst/extdata/ebs_shelf_strata_1982.dbf
Binary file not shown.
1 change: 0 additions & 1 deletion inst/extdata/ebs_shelf_strata_1982.prj

This file was deleted.

Binary file removed inst/extdata/ebs_shelf_strata_1982.sbn
Binary file not shown.
Binary file removed inst/extdata/ebs_shelf_strata_1982.sbx
Binary file not shown.
Binary file removed inst/extdata/ebs_shelf_strata_1982.shp
Binary file not shown.
Binary file removed inst/extdata/ebs_shelf_strata_1982.shx
Binary file not shown.
1 change: 0 additions & 1 deletion inst/extdata/ebs_shelf_strata_1987.cpg

This file was deleted.

Binary file removed inst/extdata/ebs_shelf_strata_1987.dbf
Binary file not shown.
1 change: 0 additions & 1 deletion inst/extdata/ebs_shelf_strata_1987.prj

This file was deleted.

Binary file removed inst/extdata/ebs_shelf_strata_1987.sbn
Binary file not shown.
Binary file removed inst/extdata/ebs_shelf_strata_1987.sbx
Binary file not shown.
Binary file removed inst/extdata/ebs_shelf_strata_1987.shp
Binary file not shown.
3 changes: 0 additions & 3 deletions inst/extdata/ebs_shelf_strata_1987.shp.xml

This file was deleted.

Binary file removed inst/extdata/ebs_shelf_strata_1987.shx
Binary file not shown.

0 comments on commit 6b72a58

Please sign in to comment.