Section 3 of 7
Package Usage
Jason Flower, Echelle S. Burns, Daniel C. Dunn, Andy Estep, Jason D. Everett, Jeffrey O. Hanson, Sarah E. Lester, and Anthony J. Richardson · about 9 minutes
The package can acquire and process bathymetric, biophysical, and geomorphology data that are suitable for use in multiple modeling, mapping, and spatial planning contexts (Table 2). For example, data acquired using the package could be used to model fishing fleet behavior and effort distribution (see Section 3.2) or model species distributions in conjunction with observation data. Furthermore, all data acquired via the package are suitable for use in marine spatial planning using prioritization tools, such as the prioritizr R package (see Section 3.1). Data can also be used for site selection in industry applications, such as aquaculture and renewable energy, and for mapping for stakeholder engagement processes. More broadly, the sf vector data and SpatRaster raster data formats used as inputs and outputs by the package functions are widely used and can therefore be easily integrated into other spatial data processing and analysis workflows.
Use case | How oceandatr can be used | Other R packages that could aid analysis
Species distribution models | Retrieve gridded data to use as predictors of species presence or abundance | robis (Provoost et al. 2022) and rgbif (Chamberlain et al. 2025) for accessing species occurrence data. ENMeval (Kass et al. 2021) for model fitting and tuning, inlabru (Bachl et al. 2019) for Bayesian spatial modeling
Fishing vessel behavior models | Retrieve gridded physical and environmental data to be used as explanatory variables and fisheries data as a response variable | sdmpredictors (Bosch and Fernandez 2023) enables download of additional environmental data. mgcv (Wood 2017) for modeling
Spatial planning: conservation planning | Retrieve gridded and classified data that can be used as inputs in a spatial prioritization | prioritizr (Hanson et al. 2025) for running a spatial prioritization
Spatial planning: site selection for aquaculture, marine renewable energy, and other industries | Retrieve data used in geospatial analysis such as multi‐criteria evaluation models | ipdw (Stachelek 2023) for interpolating point data into raster layers
Stakeholder consultation and participatory mapping | Retrieve data for use in maps that can aid stakeholder discussions about MSP | tmap (Tennekes 2018) and ggplot (Wickham 2016) for creating maps. Shiny (Chang et al. 2025) for interactive web applications
Case Study: Spatial Conservation Planning
The following case study illustrates the use of the package to acquire and process geospatial data that is then used directly to identify priority areas for protection. This type of conservation planning exercise requires several inputs: a planning region (area of interest), features of interest (e.g., species or habitats) that can be conserved by selecting planning units (spatial units within the planning region), cost data for each planning unit, and a target amount of each feature to conserve within selected planning units (Ardron et al. 2010). The cost data can be the economic cost of protecting a planning unit (e.g., money required to buy spatial area delineated by the planning unit), but in many contexts, especially ocean planning, opportunity cost is used, i.e., the value of each planning unit to fisheries assuming fishing would be prohibited in protected locations. After assembling these data, they can be input into a conservation planning decision support tool, such as the prioritizr R package (Hanson et al. 2025) and, in turn, used to identify priority areas for protection or implementation of conservation management actions.
To demonstrate the utility of oceandatr in a conservation planning workflow, we use a high seas area of the Pacific Ocean as a case study (Figure 2). We created the polygon for the planning region using the get_boundary() function to obtain all high seas areas and then cropped the polygon to the part of the Pacific of interest (~0°–6°N and 135°–155°E, Figure 2). Next, we used the get_grid() function to create a spatial grid (comprising 10 km × 10 km grid cells) to serve as planning units for the case study. The spatial grid was then passed to the get_features() function which calls each of the separate functions to obtain data on bathymetry, geomorphology, buffered seamount peaks, knolls, coral habitat and environmental zones, and returns a multi‐layer raster or multi‐attribute vector. We used apparent fishing effort as the cost, using the get_gfw() function to obtain the total annual fishing effort for 2022. Another option would be to use distance from shore or port through the get_dist() function, with the assumption that areas closer to the coast or port have greater fishing effort since they are more easily accessible. On an Intel Core i7‐8700T CPU@2.40GHz Desktop PC with 6 cores and 16GB of memory, the data retrieval and processing workflow using oceandatr took 2 min and 16 s, resulting in a total of 19 raster layers with 8142 cells (planning units). The elapsed time will vary depending on internet connection speed, computer processing power, and the resolution of the data created.

FIGURE 2: Workflow for using the oceandatr package to acquire and process data (blue boxes) to generate a prioritization with the prioritizr package (gray box). The workflow has five stages: (i) defining the planning region, (ii) generating planning units, (iii) generating feature data, (iv) generating cost data, and (v) generating a prioritization. Each box denotes a stage of the workflow, and maps are the output from each stage. Blue text boxes show the oceandatr functions associated with each stage. Depth data shown in the map of the planning region is from the GEBCO 2026 global terrain model (GEBCO Bathymetric Compilation Group 2026) accessed using the get_bathymetry() function in oceandatr.
The data obtained using oceandatr can be used directly in prioritizr and other spatial prioritization tools such as Marxan (Ball et al. 2009) and Zonation (Moilanen et al. 2009). For this example, we used targets of 20% of the area for each feature to conserve, although any target between 0 and 100% can be used, and prioritizr yields a solution (the priority areas for protection; Figure 2). The same workflow can be used to quickly and simply create a spatial prioritization for any ocean area. Data that are not part of the oceandatr package can be prepared for prioritization using the get_data_in_grid() function. This function intersects planning units with the provided data, automatically projecting data into the desired coordinate reference system, and could be used for data preparation for terrestrial and freshwater spatial prioritization contexts.
Case Study: Modeling Fishing Effort
This case study demonstrates the use of oceandatr to obtain and standardize human use and environmental data for modeling fishing effort. Numerous factors drive the behavior of fishing fleets and where they allocate fishing effort, including weather conditions (Lehodey et al. 2006), distance from port (Caddy and Carocci 1999), and the distribution and abundance of the target species. Understanding the relationship between physical and environmental factors and fishing effort is important for resource management (Vaihola and Kininmonth 2023). There are many models and modeling frameworks available, but in this example we use a Generalized Additive Model (GAM), which accommodates non‐linear environmental relationships and inherent spatial autocorrelation and is widely used for spatial modeling in fisheries contexts (Mugo et al. 2010; Stock et al. 2020; Vaihola and Kininmonth 2023).
The workflow was similar to that in the first case study ( 3.1 Case study: Spatial Conservation Planning). Spatial boundaries for the area of interest were obtained using the get_boundary() function, a spatial grid was created using get_grid(), and data were obtained using relevant functions (e.g., get_bathymetry and get_enviro_zones()). We chose the Federated States of Micronesia (FSM) as the area of interest, because it has extensive Global Fishing Watch fishing effort data available for its exclusive economic zone (EEZ). The EEZ boundary was obtained using get_boundary(“Micronesia”), and the get_grid() function was used to create a spatial grid (comprising 10 km x 10 km grid cells) for all the model data. We downloaded and standardized all data needed for the modeling process using: get_gfw() to obtain mean annual fishing effort for 2024–2025 from Global Fishing Watch, get_bathymetry() and get_dist() to obtain seafloor depth and distance from port respectively, and get_enviro_zones() with the argument enviro_zones = FALSE to obtain sea surface environmental data, including mean temperature, pH and chlorophyll‐a concentration. The environmental data were subset to only the mean sea surface temperature (SST) and dissolved oxygen concentration data because these influence tuna distributions (Vaihola and Kininmonth 2023) which is the principal target species for fishing fleets in the FSM (Bell et al. 2021). All data were then combined into a single, multi‐layer raster (Figure 3), and converted to a dataframe ready for the GAM.

FIGURE 3: Spatial data for the Federated States of Micronesia's EEZ used in the Generalized Additive Model. Mean fishing effort is the response variable, while seafloor depth, distance to port, mean temperature, and dissolved oxygen are the predictors. All data were obtained and gridded using oceandatr functions.
We created a GAM using the gam() function in the package mgcv (Wood 2017). Predictor variables (seafloor depth, distance to port, SST and dissolved oxygen) were modeled using penalized thin‐plate regression splines, while a geographic Gaussian process smoother was integrated to account for spatial dependency across the spatial grid. The model was fitted via Restricted Maximum Likelihood (REML) estimation using the log+1 transformed response (fishing effort) variable to address data skewness and stabilize residual variance, and we used a normal error structure. We fitted only a single GAM with the four predictor variables because this case study was intended to demonstrate the functionality of oceandatr, although we acknowledge that a more rigorous modeling process would include variable selection procedures (e.g., via the MuMIn package, Bartoń 2026). The resulting model successfully captured the spatial distribution of fishing effort (adjusted R 2 = 0.49) and all predictor variables had highly significant, non‐linear effects (p < 0.001). We used the predict.gam() function from the mgcv package to predict fishing effort in FSM to visually compare the Global Fishing Watch fishing effort data with fishing effort predicted by the GAM (Figure 4).

FIGURE 4: Comparison of GAM predictions of fishing effort to fishing effort data from Global Fishing Watch that was the model response variable.
The case study illustrates the ease with which spatial modeling can be done using oceandatr to obtain standardized data ready for the modeling process. The code to repeat the workflow outlined here is available on the oceandatr website as a vignette (https://emlab‐ucsb.github.io/oceandatr/articles/fishing_prediction.html).