diff --git a/R/splnr_get_gfw.R b/R/splnr_get_gfw.R index ef4ead5..6d8c24d 100644 --- a/R/splnr_get_gfw.R +++ b/R/splnr_get_gfw.R @@ -129,7 +129,7 @@ splnr_get_gfw <- function(region, # Determine the region ID based on the region_source and region type. if (region_source == "EEZ" & is.character(region)){ - region_id <- gfwr::get_region_id(region_name = region, region_source = region_source, key = key)$id + region_id <- gfwr::gfw_region_id(region = region, region_source = region_source, key = key)$id } else if (region_source == "EEZ" & is.numeric(region)){ # If region is numeric for EEZ, assume it's already an ID. region_id <- region @@ -149,7 +149,7 @@ splnr_get_gfw <- function(region, get_data_for_range <- function(start_date, end_date, rid) { # Call the gfwr::get_raster function to retrieve GFW raster data. - data <- gfwr::get_raster( + data <- gfwr::gfw_ais_fishing_hours( spatial_resolution = spat_res, temporal_resolution = temp_res, group_by = 'FLAGANDGEARTYPE', # Group by flag and geartype. diff --git a/docs/articles/ClimateSmart.html b/docs/articles/ClimateSmart.html index e41f02f..baf744b 100644 --- a/docs/articles/ClimateSmart.html +++ b/docs/articles/ClimateSmart.html @@ -171,7 +171,7 @@


In our case, there were few areas with low climate velocity, which are the areas we define as climate refugia in our example. Usually, we would combine several metrics (e.g. exposure, velocity etc.) of multiple @@ -226,7 +226,7 @@


We then use the climate priority area approach
splnr_climate_priorityAreaApproach() detailed in Buenafe et al (2023) to
determine climate refugia. Briefly, this approach selects a percentile
@@ -306,7 +306,7 @@


However, we are also interested how climate-smart the selected planning units in the solution actually are. For this, we can use a kernel density plot.
@@ -318,7 +318,7 @@



However, we are also interested how climate-smart the selected planning units in the solution actually are. For this, we can use a kernel density plot
@@ -397,7 +397,7 @@



However, we are also interested how climate-smart the selected planning units in the solution actually are. For this, we can use a kernel density plot
@@ -466,7 +466,7 @@

The gfwr package provides convenient functions to pull
GFW data directly into R into usable formats. It contains three main
-functions, including : get_vessel_info(),
-get_event() and get_raster(). The two first
+functions, including : get_vessel_info(),
+get_event() and get_raster(). The two first
being devoted to retrieving information and features on one ore several
specific vessels. The last is of particular interest to us because it
allows us to gather information from global fishing watch raster on the
@@ -131,7 +131,7 @@
-region_id <- get_region_id(region = "Australia",
+region_id <- get_region_id(region = "Australia",
region_source = "EEZ",
key = gfwr::gfw_auth())$id[2]
The get_raster function gets a raster of fishing effort
@@ -147,7 +147,7 @@
-get_raster(
+get_raster(
spatial_resolution = "LOW",
temporal_resolution = "MONTHLY",
group_by = "FLAGANDGEARTYPE",
@@ -204,12 +204,12 @@ Here
-

+
Fishing gear type
@@ -241,14 +241,14 @@ Fishing gear type= "2019-12-31",
end_date = "2021-01-01",
temp_res = "MONTHLY")
-
+
Supplementary materials.
diff --git a/docs/articles/GlobalFishingWatch.md b/docs/articles/GlobalFishingWatch.md
index 05e738e..8d01469 100644
--- a/docs/articles/GlobalFishingWatch.md
+++ b/docs/articles/GlobalFishingWatch.md
@@ -5,10 +5,10 @@
The `gfwr` package provides convenient functions to pull GFW data
directly into R into usable formats. It contains three main functions,
including :
-[`get_vessel_info()`](https://globalfishingwatch.github.io/gfwr/reference/get_vessel_info.html),
-[`get_event()`](https://globalfishingwatch.github.io/gfwr/reference/get_event.html)
+[`get_vessel_info()`](https://globalfishingwatch.github.io/gfwr/reference/gfw_renamed.html),
+[`get_event()`](https://globalfishingwatch.github.io/gfwr/reference/gfw_renamed.html)
and
-[`get_raster()`](https://globalfishingwatch.github.io/gfwr/reference/get_raster.html).
+[`get_raster()`](https://globalfishingwatch.github.io/gfwr/reference/gfw_renamed.html).
The two first being devoted to retrieving information and features on
one ore several specific vessels. The last is of particular interest to
us because it allows us to gather information from global fishing watch
@@ -25,14 +25,14 @@ fishing.
#### AIS Caveats and limitations
-The AIS coverage of vessels has several limitations such as:
+The AIS coverage of vessels has several limitations such as:\
1. The number of vessels that are captured (AIS provides approximately
-70’000 of the 2.8 million identified fishing vessels).
+70’000 of the 2.8 million identified fishing vessels).\
2. The size of the vessels (52-85% for vessels larger than 24 meters
-against 1% for vessels under 12 meters).
+against 1% for vessels under 12 meters).\
*Good to know: IMO mandates AIS for most vessels larger than 36
-meters.*
-3. AIS interference with each other in areas of high vessel density.
+meters.*\
+3. AIS interference with each other in areas of high vessel density.\
4. Some terrestrial satellites only receive messages near shore.
### Installation
@@ -50,13 +50,13 @@ library(spatialplanr)
### API
-To access GFW APIs, you need to :
-1. register for a GFW account [here](http://bit.ly/447cRG9).
+To access GFW APIs, you need to :\
+1. register for a GFW account [here](http://bit.ly/447cRG9).\
2. Request API key
[here](https://globalfishingwatch.org/our-apis/tokens).
Once you have your token, add it to your .Renviron file (by executing
-the chunk below), by writing (GFW_TOKEN = “YOUR_TOKEN”) in the file.
+the chunk below), by writing (GFW_TOKEN = “YOUR_TOKEN”) in the file.\
*(You could be asked to restart R for changes to take effect.)*
``` r
@@ -82,9 +82,9 @@ different resolution), the `Vessel IDs`, `Flag`, `Geartype` and
`Apparent fishing Hours` which are basically the amount of fishing hours
of each vessel per grid cell (`geometry`).
-Data can be provided through :
-- `DAILY`, `MONTHLY` and `YEARLY` temporal resolutions.
-- `LOW` (0.1 deg) and `HIGH` (0.01 deg) spatial resolutions.
+Data can be provided through :\
+- `DAILY`, `MONTHLY` and `YEARLY` temporal resolutions.\
+- `LOW` (0.1 deg) and `HIGH` (0.01 deg) spatial resolutions.\
- `VESSEL_ID`, `FLAG`, `GEARTYPE`, `FLAGANDGEARTYPE`.
``` r
@@ -121,9 +121,9 @@ data_sf_combined <- splnr_get_gfw(region = "Australia",
### Visualization
-To display the data, we load :
+To display the data, we load :\
- The coastline from `rnaturalearth` package and modify it to get an sf
-object, and we constrain it to the boundaries of the given data.
+object, and we constrain it to the boundaries of the given data.\
- EEZ Polygons from `oceandatr` package
``` r
@@ -156,7 +156,7 @@ eezs <- spatialgridr::get_boundary(name = "Australia", type = "eez", country_typ
#### Year-on-year comparison
We may need to compare different timeframes, such as seasons, to see if
-there are any patterns.
+there are any patterns.\
**Note :** As more vessels have adopted AIS (mainly in economically
developed countries) since the deployment of these technologies, the
rise in activities must be seen in the context of this increase and not
@@ -209,7 +209,7 @@ details on AIS operation and limitations
#### Hierarchy of vessels gear types :

+Hierarchy](https://globalfishingwatch.org/wp-content/uploads/figure6_fishing_classification_hierarchy-1.jpg)\
*Source :
*
diff --git a/docs/articles/GlobalFishingWatch_files/figure-html/unnamed-chunk-10-1.png b/docs/articles/GlobalFishingWatch_files/figure-html/unnamed-chunk-10-1.png
index cf88def..b2d50ca 100644
Binary files a/docs/articles/GlobalFishingWatch_files/figure-html/unnamed-chunk-10-1.png and b/docs/articles/GlobalFishingWatch_files/figure-html/unnamed-chunk-10-1.png differ
diff --git a/docs/articles/GlobalFishingWatch_files/figure-html/unnamed-chunk-13-1.png b/docs/articles/GlobalFishingWatch_files/figure-html/unnamed-chunk-13-1.png
index 896aa46..4231a98 100644
Binary files a/docs/articles/GlobalFishingWatch_files/figure-html/unnamed-chunk-13-1.png and b/docs/articles/GlobalFishingWatch_files/figure-html/unnamed-chunk-13-1.png differ
diff --git a/docs/articles/GlobalFishingWatch_files/figure-html/unnamed-chunk-15-1.png b/docs/articles/GlobalFishingWatch_files/figure-html/unnamed-chunk-15-1.png
index 375423f..ff1629c 100644
Binary files a/docs/articles/GlobalFishingWatch_files/figure-html/unnamed-chunk-15-1.png and b/docs/articles/GlobalFishingWatch_files/figure-html/unnamed-chunk-15-1.png differ
diff --git a/docs/articles/GlobalFishingWatch_files/figure-html/unnamed-chunk-7-1.png b/docs/articles/GlobalFishingWatch_files/figure-html/unnamed-chunk-7-1.png
index 67376b6..5013e9b 100644
Binary files a/docs/articles/GlobalFishingWatch_files/figure-html/unnamed-chunk-7-1.png and b/docs/articles/GlobalFishingWatch_files/figure-html/unnamed-chunk-7-1.png differ
diff --git a/docs/articles/GlobalFishingWatch_files/figure-html/unnamed-chunk-8-1.png b/docs/articles/GlobalFishingWatch_files/figure-html/unnamed-chunk-8-1.png
index 0322f1e..6eb3fc1 100644
Binary files a/docs/articles/GlobalFishingWatch_files/figure-html/unnamed-chunk-8-1.png and b/docs/articles/GlobalFishingWatch_files/figure-html/unnamed-chunk-8-1.png differ
diff --git a/docs/articles/MultipleUse.html b/docs/articles/MultipleUse.html
index 8ca5630..ea2563b 100644
--- a/docs/articles/MultipleUse.html
+++ b/docs/articles/MultipleUse.html
@@ -211,7 +211,7 @@ Spatial planning including zones
(ggSoln <- splnr_plot_solution(s1) +
splnr_gg_add(PUs = PUs, Bndry = Bndry, overlay = landmass, cropOverlay = PUs, ggtheme = splnr_theme))
-
+
We can also have a look at how well the set target was met.
s1T <- s1 %>%
@@ -292,7 +292,7 @@ Different cost layers PUs = PUs, Bndry = Bndry, overlay = landmass,
cropOverlay = PUs, ggtheme = splnr_theme
))
-
+
We can see that we now how planning units that are not selected, and
planning units that have either been selected for zone 1 or zone 2.
@@ -425,7 +425,7 @@ Different features= PUs, Bndry = Bndry, overlay = landmass,
cropOverlay = PUs, ggtheme = splnr_theme
))
-



A boundary penalty can also be introduced to only one zone:
zm2 <- zm1
@@ -513,7 +513,7 @@ Within the same zone= PUs, Bndry = Bndry, overlay = landmass,
cropOverlay = PUs, ggtheme = splnr_theme
))








(gg_s8 <- splnr_plot_solution(s8) +
splnr_gg_add(PUs = PUs, Bndry = Bndry, overlay = landmass, cropOverlay = PUs, ggtheme = splnr_theme))

NOTE: We can also use multiple linear constraints in the same plan, however, this might require a normalization of the input data to have the constraints in comparable units, and a careful tuning @@ -826,7 +826,7 @@


The plot also reflects the observation above that PUs were more
frequently selected in zone1. What if we wanted to
constrain this, so that zone1 is less often selected and
@@ -905,7 +905,7 @@


However, we also expect the cost for the spatial plan to be higher than the previous one.
@@ -919,13 +919,13 @@
targetAcrossSome <- Dict %>%
dplyr::mutate(
- target = dplyr::case_when(
+ target = dplyr::case_when(
category == "Reptiles" ~ 30 / 100,
category == "Mammals" ~ 10 / 100,
category == "Sharks and rays" ~ 5 / 100,
TRUE ~ 0
),
- zone = dplyr::case_when(
+ zone = dplyr::case_when(
category == "Reptiles" ~ list(c("zone1", "zone2")),
category == "Mammals" ~ list("zone2"),
category == "Sharks and rays" ~ list("zone3"),
@@ -1024,7 +1024,7 @@ Targets across some (but not all)
PUs = PUs, Bndry = Bndry, overlay = landmass,
cropOverlay = PUs, ggtheme = splnr_theme
))


(ggPU <- splnr_plot(df = PUs) +
ggplot2::theme_bw()) # Plot Planning Units

If we want to add additional properties to our map, for example
landmass or the boundary, we can use splnr_gg_add().
@@ -138,7 +138,7 @@Create Planning Units Bndry = Bndry, overlay = landmass, cropOverlay = PUs, ggtheme = "Default" ))


We can also use a customised ggplpot theme that can be
passed as a list to splnr_gg_add() and that can then be
used for all plots. For example:




The suitable habitat for Green sea turtles as predicted by Aquamaps is restricted to few cells close to the coast. If we now compare this with the predicted suitable habitat for Humpback whales, we can see that @@ -233,7 +233,7 @@


In our example, this was the only reason why we classified species as either representative if their suitable habitat is wide-ranging within the study region or important if they are restricted to a few number of @@ -251,7 +251,7 @@






This plot shows the optimal solution for the planning region that meets the selected targets for the chosen features for the smallest area possible. The categorical map displays, which of the planning units were @@ -392,7 +392,7 @@


Note: In our example, cost is equal for all planning units.
@@ -418,7 +418,7 @@

For a circular bar plot, one additional step of data preparation needs to be done.
@@ -470,7 +470,7 @@Visualization of importance scores#> Calculating Rarity Weighted Richness. (ggScores <- patchwork::wrap_plots(ggFerrier + ggRWR))


In our example, both scores label similar -coastal- planning units as most important for the spatial plan.
@@ -499,7 +499,7 @@

We will also include targets based on IUCN categories to prioritise species with an IUCN status of:


But we locked-in areas that were already existing Marine Protected Areas (MPAs). If we want to show the overlap between the selected Planning Units and the current MPAs, we can add this to the @@ -570,7 +570,7 @@


If we instead only want to see the contours of the locked-in areas we
can set typeLockIn = "Contours" in
splnr_gg_add().




This plot shows how the first solution (without current MPAs) differs from the second solution (including current MPAs. The categorical map displays, which of the planning units were selected in solution 2 but @@ -607,7 +607,7 @@


The correlation matrix shows the similarity as the Cohen’s Kappa correlation between solution 1 and solution 2.
@@ -637,7 +637,7 @@

Source: DESCRIPTION
Everett J, Neubert S (2025). +
Everett J, Neubert S (2026). spatialplanr: Help files for prioritzr Spatial Planning projects. R package version 0.7.0, https://github.com/SpatialPlanning/spatialplanr.
@Manual{,
title = {spatialplanr: Help files for prioritzr Spatial Planning projects},
author = {Jason D. Everett and Sandra Neubert},
- year = {2025},
+ year = {2026},
note = {R package version 0.7.0},
url = {https://github.com/SpatialPlanning/spatialplanr},
}
diff --git a/docs/authors.md b/docs/authors.md
index 028ac95..8c7a542 100644
--- a/docs/authors.md
+++ b/docs/authors.md
@@ -12,14 +12,14 @@
Source:
[`DESCRIPTION`](https://github.com/SpatialPlanning/spatialplanr/blob/HEAD/DESCRIPTION)
-Everett J, Neubert S (2025). *spatialplanr: Help files for prioritzr
+Everett J, Neubert S (2026). *spatialplanr: Help files for prioritzr
Spatial Planning projects*. R package version 0.7.0,