On Anon

Longline

Summary:

  • Only longlines in year 2018
  • Spatial grids tried: 250, 500, 1000, 2000, 3000, 4000, 5000 meters
  • Counted number of distinct vessels per grid and then proportion of area per number of distinct vessels
Code
library(tidyverse)
library(arrow)
library(sf)
island <- 
  geo::island |> 
  st_as_sf(coords = c("lon", "lat"),
           crs = 4326) |> 
  st_transform(crs = 3857) |>
  summarise(do_union = FALSE) |> 
  st_cast("LINESTRING") |> 
  st_cast("POLYGON")

sc_arrow <-
  tribble(~gid,  ~s1,  ~s2,
          -199, 1.000, 3.000,
          1,    0.375, 2.750,
          2,    0.125, 2.500,
          3,    0.025, 2.000,
          5,    0.250, 3.250,
          6,    2.625, 5.500,
          7,    2.625, 6.000,
          9,    2.375, 4.000,
          12,    0.050, 2.250,
          14,    1.750, 3.250,
          15,    0.500, 5.500,
          38,    0.250, 4.750,
          40,    0.250, 6.000) |> 
  mutate(gid = as.integer(gid)) |> 
  arrow::as_arrow_table()
ais <- 
  open_dataset("/home/haf/einarhj/stasi/fishydata_2024-11-09/data/ais_2024-05-01") |> 
  left_join(sc_arrow) |> 
  filter(!is.na(.sid),
         year(time) == 2018,
         gid == 1,
         speed >= s1, speed <= s2,
         lon >= -33, lon <= -10,
         lat >=  62, lat <= 68.5)
dx <- c(seq(5000, 1000, by = -1000), 500, 250)
res <- list()
for(g in 1:length(dx)) {
  res[[g]] <-
    ais |> 
    mutate(x = x %/% dx[g] * dx[g] + dx[g]/2,
           y = y %/% dx[g] * dx[g] + dx[g]/2) |> 
    group_by(x, y) |> 
    summarise(n_vid = n_distinct(vid),
              .groups = "drop") |> 
    collect()
}
names(res) <- dx
d <- 
  bind_rows(res, .id = "grid") |> 
  mutate(grid = as.integer(grid))


d |> 
  group_by(grid, n_vid) |> 
  summarise(n = n()) |> 
  group_by(grid) |> 
  mutate(p = round(n / sum(n) * 100, 1)) |> 
  select(grid, n_vid, p) |> 
  spread(grid, p) |> 
  knitr::kable(caption = "Longline: Percent of total grid area per number of distinct vessels", digits = 1)
Longline: Percent of total grid area per number of distinct vessels
n_vid 250 500 1000 2000 3000 4000 5000
1 80.7 70.3 57.6 44.1 37.1 33.1 30.3
2 14.8 20.1 24.1 25.0 24.0 22.7 21.7
3 3.2 6.1 10.3 14.1 15.4 15.5 15.5
4 0.9 2.1 4.3 7.9 9.6 10.6 10.8
5 0.3 0.8 1.9 4.1 5.9 6.9 7.5
6 0.1 0.3 0.9 2.1 3.4 4.4 5.1
7 0.0 0.2 0.4 1.1 1.8 2.6 3.4
8 0.0 0.1 0.2 0.7 1.0 1.5 1.9
9 0.0 0.0 0.1 0.4 0.7 1.0 1.2
10 0.0 0.0 0.1 0.2 0.4 0.6 0.9
11 NA 0.0 0.0 0.1 0.3 0.4 0.6
12 NA 0.0 0.0 0.1 0.2 0.3 0.3
13 NA 0.0 0.0 0.1 0.1 0.2 0.3
14 NA NA 0.0 0.0 0.1 0.1 0.2
15 NA NA 0.0 0.0 0.0 0.1 0.1
16 NA NA NA 0.0 0.0 0.1 0.1
17 NA NA NA 0.0 0.0 0.0 0.1
18 NA NA NA NA 0.0 0.0 0.0
19 NA NA NA 0.0 0.0 0.0 0.0
20 NA NA NA NA 0.0 0.0 0.0
21 NA NA NA NA NA 0.0 0.0
Code
d |> 
  filter(grid == 5000) |> 
  mutate(n_vid = case_when(n_vid >= 3 ~ "3+",
                           .default = as.character(n_vid))) |> 
  ggplot() +
  theme_void() +
  geom_tile(aes(x, y, fill = n_vid)) +
  geom_sf(data = island, fill = "grey") +
  scale_fill_viridis_d(direction = 1) +
  coord_sf() +
  labs(fill = "Distinct\nvessels")

Longline: 5000 x 5000 meter grid
Code
d |> 
  filter(grid == 1000) |> 
  mutate(n_vid = case_when(n_vid >= 3 ~ "3+",
                           .default = as.character(n_vid))) |> 
  ggplot() +
  theme_void() +
  geom_tile(aes(x, y, fill = n_vid)) +
  geom_sf(data = island, fill = "grey") +
  scale_fill_viridis_d(direction = 1) +
  coord_sf() +
  labs(fill = "Distinct\nvessels")

Longline: 1000 x 1000 meter grid

Bottom trawl

Summary:

  • Only fish trawls in year 2018
  • Spatial grids tried: 250, 500, 1000, 2000, 3000, 4000, 5000 meters
  • Counted number of distinct vessels per grid and then proportion of area per number of distinct vessels
Code
library(tidyverse)
library(arrow)
sc_arrow <-
  tribble(~gid,  ~s1,  ~s2,
          -199, 1.000, 3.000,
          1,    0.375, 2.750,
          2,    0.125, 2.500,
          3,    0.025, 2.000,
          5,    0.250, 3.250,
          6,    2.625, 5.500,
          7,    2.625, 6.000,
          9,    2.375, 4.000,
          12,    0.050, 2.250,
          14,    1.750, 3.250,
          15,    0.500, 5.500,
          38,    0.250, 4.750,
          40,    0.250, 6.000) |> 
  mutate(gid = as.integer(gid)) |> 
  arrow::as_arrow_table()
ais <- 
  open_dataset("/home/haf/einarhj/stasi/fishydata_2024-11-09/data/ais_2024-05-01") |> 
  left_join(sc_arrow) |> 
  filter(!is.na(.sid),
         year(time) == 2018,
         gid == 6,
         speed >= s1, speed <= s2,
         lon >= -33, lon <= -10,
         lat >=  62, lat <= 68.5)
dx <- c(seq(5000, 1000, by = -1000), 500, 250)
res <- list()
for(g in 1:length(dx)) {
  res[[g]] <-
    ais |> 
    mutate(x = x %/% dx[g] * dx[g] + dx[g]/2,
           y = y %/% dx[g] * dx[g] + dx[g]/2) |> 
    group_by(x, y) |> 
    summarise(n_vid = n_distinct(vid),
              .groups = "drop") |> 
    collect()
}
names(res) <- dx
d <- 
  bind_rows(res, .id = "grid") |> 
  mutate(grid = as.integer(grid))


d |> 
  group_by(grid, n_vid) |> 
  summarise(n = n()) |> 
  group_by(grid) |> 
  mutate(p = round(n / sum(n) * 100, 1)) |> 
  select(grid, n_vid, p) |> 
  spread(grid, p) |> 
  knitr::kable(caption = "Bottom trawl: Percent of total grid area per number of distinct vessels", digits = 1)
Bottom trawl: Percent of total grid area per number of distinct vessels
n_vid 250 500 1000 2000 3000 4000 5000
1 54.8 43.6 34.8 29.1 26.5 25.1 23.9
2 21.7 21.6 18.9 16.1 15.0 14.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 NA 0.0 0.0 0.1 0.1 0.1 0.1
38 NA NA 0.0 0.1 0.1 0.1 0.1
39 NA NA 0.0 0.0 0.1 0.1 0.1
40 NA NA 0.0 0.0 0.1 0.1 0.1
41 NA NA NA 0.0 0.0 0.1 0.1
42 NA NA NA 0.0 0.0 0.0 0.1
43 NA NA NA NA 0.0 0.0 0.0
44 NA NA NA NA NA 0.0 0.0
Code
d |> 
  filter(grid == 5000) |> 
   mutate(n_vid = case_when(n_vid >= 3 ~ "3+",
                           .default = as.character(n_vid))) |> 
  ggplot() +
  theme_void() +
  geom_tile(aes(x, y, fill = n_vid)) +
  geom_sf(data = island, fill = "grey") +
  scale_fill_viridis_d(direction = 1) +
  coord_sf() +
  labs(fill = "Distinct\nvessels")

Bottom fish trawl: 5000 x 5000 meter grid
Code
d |> 
  filter(grid == 1000) |> 
  mutate(n_vid = case_when(n_vid >= 3 ~ "3+",
                           .default = as.character(n_vid))) |> 
  ggplot() +
  theme_void() +
  geom_tile(aes(x, y, fill = n_vid)) +
  geom_sf(data = island, fill = "grey") +
  scale_fill_viridis_d(direction = 1) +
  coord_sf() +
  labs(fill = "Distinct\nvessels")

Bottom fish trawl: 1000 x 1000 meter grid