afsc-gap-products / akgfmaps

Make AFSC bottom trawl survey maps and retrieve map layers
Other
17 stars 6 forks source link

AI grid cells spanning multiple columns/rows #106

Open sean-rohan-NOAA opened 7 months ago

sean-rohan-NOAA commented 7 months ago

Issue

In the AI, two ID cell grids (98-19 and 41-48) span across multiple grid cells.

library(akgfmaps)

ai_grid_3338 <- akgfmaps::get_base_layers(select.region = "ai", set.crs = "EPSG:3338")$survey.grid

ai_grid_union <- dplyr::select(ai_grid_3338, ID) |>
  dplyr::group_by(ID) |>
  summarise()

ai_grid_union$area <- sf::st_area(ai_grid_union)

ggplot() +
  geom_sf(data = dplyr::arrange(ai_grid_union, -area)[1,],
          linewidth = 3) +
  geom_sf_text(data = dplyr::arrange(ai_grid_union, -area)[1,] |>
            sf::st_centroid(),
            mapping = aes(label = ID))

ggplot() +
  geom_sf(data = dplyr::arrange(ai_grid_union, -area)[2,],
          linewidth = 3) +
  geom_sf_text(data = dplyr::arrange(ai_grid_union, -area)[2,] |>
                 sf::st_centroid(),
               mapping = aes(label = ID))

image

image