Skip to content

Commit

Permalink
Merge pull request #141 from afsc-gap-products/dev2
Browse files Browse the repository at this point in the history
Fix GOA 2025 station names
  • Loading branch information
sean-rohan-NOAA authored Jan 7, 2025
2 parents f30db1a + e323220 commit 3b4aebc
Show file tree
Hide file tree
Showing 12 changed files with 476 additions and 133 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: akgfmaps
Type: Package
Title: Alaska Groundfish and Ecosystem Survey Area Mapping
Version: 4.0.0
Date: 2025-01-03
Version: 4.0.1
Date: 2025-01-07
Authors@R: c(person("Sean", "Rohan", email = "[email protected]", role = c("aut", "cre")),
person("Emily", "Markowitz", email = "[email protected]", role = "ctb"),
person("Zack", "Oyafuso", email = "[email protected]", role = "ctb"),
Expand Down
9 changes: 9 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
akgfmaps 4.0.1 (January 7, 2025)
----------------------------------------------------------------

BUG FIX

- Change STATION fields to use GRID_X-GRID_Y-STRATUM naming
convention.


akgfmaps 4.0.0 (January 3, 2025)
----------------------------------------------------------------

Expand Down
11 changes: 5 additions & 6 deletions analysis/akgfmaps4/make_bt_gpkg.R
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,13 @@ goa_stratum_2025 |>
append = TRUE,
delete_dsn = FALSE)


goa_station_grid_2025 <-
sf::st_read(here::here("analysis", "goa_strata_2025", "goaai_grid_2025.shp")) |>
sf::st_intersection(goa_stratum_2025) |>
dplyr::mutate(AREA_M2 = as.numeric(sf::st_area(geometry)),
STATION = paste0(AREA_ID, "-", GRIDID),
sf::st_read(here::here("analysis", "goa_strata_2025", "goa_stations_2025.gpkg")) |>
dplyr::mutate(AREA_M2 = AREA_KM2*1e6,
SURVEY_DEFINITION_ID = 47,
DESIGN_YEAR = 2025,
AREA_TYPE = "STATION") |>
dplyr::select(AREA_TYPE, SURVEY_DEFINITION_ID, DESIGN_YEAR, GRID_ID = id, STATION, AREA_M2)
dplyr::select(AREA_TYPE, SURVEY_DEFINITION_ID, DESIGN_YEAR, GRID_ID = GRIDID, STATION, AREA_M2)

goa_station_grid_2025 |>
sf::st_write(dsn = here::here("inst", "extdata", "afsc_bottom_trawl_surveys.gpkg"),
Expand Down
29 changes: 29 additions & 0 deletions assets/demo/akgfmaps_SCRUG_20250122/ex1_installing_akgfmaps.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 1. Install akgfmaps using the devtools package ---------------------------------------------------

install.packages("devtools", "dplyr")
devtools::install_github(repo = "afsc-gap-products/akgfmaps")

# 2. Load akgfmaps/verify that you have version 4 installed ------------------------------------
library(akgfmaps)

# Verify that you have akgfmaps version >= 4.0.0
(session <- sessionInfo())

session$loadedOnly$akgfmaps$Version > 4

# Troubleshooting ----------------------------------------------------------------------------------

# Problem: API Rate Limit error
# Solution: Setup a GitHub Personal Access Token in R Studio
# Instructions: https://carpentries.github.io/sandpaper-docs/github-pat.html

# Workaround without API access
#
# 1. Install these packages from CRAN:
# ggplot2, sf, stars, terra, gstat (>= 2.0-1), stats, utils, methods, colorspace, RColorBrewer,
# here, ggspatial, rmapshaper, shadowtext, ggthemes, classInt (>= 0.4-1), units
#
# 2. Download the akgfmaps tarball from:
#
#
# 3. Install the akgmaps tarball using install.packages()
Loading

0 comments on commit 3b4aebc

Please sign in to comment.