# Get EEZ data first bermuda_eez<-get_boundary(name ="Bermuda")
-#> Cache is fresh. Reading: /tmp/RtmpGtftbr/eez-2205f12f/eez.shp
-#> (Last Modified: 2025-01-09 06:02:16.566641)
+#> Cache is fresh. Reading: /tmp/Rtmpvxs648/eez-2205f12f/eez.shp
+#> (Last Modified: 2025-01-10 06:44:54.084157)# Get raw seamounts dataseamount_peaks<-get_seamounts(spatial_grid =bermuda_eez, raw =TRUE)#> Spherical geometry (s2) switched off
diff --git a/reference/index.html b/reference/index.html
index acc5916..582058c 100644
--- a/reference/index.html
+++ b/reference/index.html
@@ -7,7 +7,7 @@
oceandatr
- 0.2.0
+ 0.2.1
diff --git a/reference/oceandatr-package.html b/reference/oceandatr-package.html
index d34cd14..ee99790 100644
--- a/reference/oceandatr-package.html
+++ b/reference/oceandatr-package.html
@@ -9,7 +9,7 @@
oceandatr
- 0.2.0
+ 0.2.1
diff --git a/reference/pipe.html b/reference/pipe.html
index a4087af..7a2125a 100644
--- a/reference/pipe.html
+++ b/reference/pipe.html
@@ -7,7 +7,7 @@
oceandatr
- 0.2.0
+ 0.2.1
diff --git a/reference/reexports.html b/reference/reexports.html
index f7f7fb4..edf042e 100644
--- a/reference/reexports.html
+++ b/reference/reexports.html
@@ -21,7 +21,7 @@
oceandatr
- 0.2.0
+ 0.2.1
diff --git a/search.json b/search.json
index 371b122..042d10d 100644
--- a/search.json
+++ b/search.json
@@ -1 +1 @@
-[{"path":"https://emlab-ucsb.github.io/oceandatr/articles/getboundary.html","id":"marine-boundaries","dir":"Articles","previous_headings":"","what":"Marine boundaries","title":"Retrieving boundaries with get_boundary()","text":"get_boundary() uses mregions2::mrp_get() function mregions2 package - R package Marine Regions database. database quite extensive several options querying areas. get_boundary() intended provide functionality mregions2, just slightly simpler interface getting commonly used boundaries exclusive economic zones (EEZs), global ocean boundaries, high seas areas. using get_boundary() type = \"eez\", type = \"12nm\" type = \"24nm\", country_type can either country_type = \"country\" country_type = \"sovereign\". Using \"country\" returns EEZ, 12nm 24nm boundary mainland country, using \"sovereign\" returns boundaries states territories country sovereignty well. examples show works. Note type = \"ocean\" type = \"high_seas\", country_type ignored. simple query get Australia’s EEZ: lets look happens change country_type default \"country\" \"sovereign\": now get just main country Australia, islands sovereignty . detail, see Marine Regions attribute table; using country_type = \"country\" queries using ‘territory1’ attribute, using country_type = \"sovereign\" uses ‘territory1’ attribute. another example using France. EEZ bordering mainland France retrieved country_type = \"country\", setting country_type = \"sovereign\" also get islands France sovereignty . EEZ mainland France (blue) overseas territories (solid outlines). World coastlines shown dashed line reference. example, might want use sovereign trying get islands make Kiribati. Using country_type = \"country\" return anything island group listed country. Note name provided found, list possible country_type options chose provided (part output shown brevity): Try , setting country_type = \"sovereign\": Kiribati’s EEZ. World coastlines shown dashed line reference. mregions2 package can used query many different marine boundaries, included options get_boundary():","code":"aus_eez <- get_boundary(name = \"Australia\", type = \"eez\") plot(aus_eez[\"geometry\"], axes = TRUE) aus_eez_sov <- get_boundary(name = \"Australia\", type = \"eez\", country_type = \"sovereign\") plot(aus_eez_sov[\"geometry\"], axes = TRUE) fr_eez <- get_boundary(name = \"France\", type = \"eez\", country_type = \"country\") fr_eez_sov <- get_boundary(name = \"France\", type = \"eez\", country_type = \"sovereign\") plot(sf::st_geometry(fr_eez_sov), lwd = 1, axes = TRUE) plot(fr_eez[\"geometry\"], col = \"royalblue\", add = T) plot(rnaturalearth::ne_coastline(scale = 110)[\"geometry\"], lty = 3, add = TRUE) get_boundary(name = \"Kiribati\", type = \"eez\", country_type = \"country\") kir_eez <- get_boundary(name = \"Kiribati\", type = \"eez\", country_type = \"sovereign\") plot(sf::st_geometry(kir_eez), col = \"royalblue\") plot(rnaturalearth::ne_coastline(scale = 110)[\"geometry\"], lty = 3, add = TRUE) mregions2::mrp_list[,c(\"title\", \"layer\")]"},{"path":"https://emlab-ucsb.github.io/oceandatr/articles/getboundary.html","id":"land-boundaries","dir":"Articles","previous_headings":"","what":"Land boundaries","title":"Retrieving boundaries with get_boundary()","text":"get_boundary() uses rnaturalearth::ne_countries() function [rnaturalearth``](https://docs.ropensci.org/rnaturalearth/index.html) package retrieve land boundaries.get_boundary()` intended provide slightly simpler interface getting commonly used land boundaries. maritime boundaries, country_type can specified either country_type = \"country\" country_type = \"sovereign\" depending whether main country required country territories/ states sovereignty . following examples show options work practice. rnaturalearth package vignette contains details constitutes country options querying. query France setting country_type = \"country\" get: slightly unexpected perhaps, islands Guadeloupe Martinique Caribbean, Mayotte Réunion Western Indian Ocean, French Guiana South America, status mainland France. use country_type = \"sovereign\", also get France’s overseas territories Pacific, Atlantic Antarctic:","code":"france <- get_boundary(name = \"France\", type = \"countries\", country_type = \"country\") plot(sf::st_geometry(france), col = \"blue\") plot(rnaturalearth::ne_coastline(scale = 110)[\"geometry\"], lty = 3, add = TRUE) france_sov <- get_boundary(name = \"France\", type = \"countries\", country_type = \"sovereign\") plot(sf::st_geometry(france_sov), col = \"blue\") plot(rnaturalearth::ne_coastline(scale = 110)[\"geometry\"], lty = 3, add = TRUE)"},{"path":"https://emlab-ucsb.github.io/oceandatr/articles/pacific_high_seas_example.html","id":"high-seas-area-of-the-pacific-ocean","dir":"Articles","previous_headings":"","what":"High Seas area of the Pacific Ocean","title":"Pacific High Seas Example","text":"First retrieve geospatial data North Pacific Ocean using get_boundary(), crop area interested , highlighted red map. Map High Seas going use highlighted Pacific area borders Indonesia, Papua New Guinea, Palau Federated States Micronesia. can get EEZs states using oceandatr’s get_area function. want high sea portion area outlined . can now create polygon remove bordering states EEZs. Map Pacific High Seas area regional context Now select suitable projection area suitable resolution planning grid used gridding data. can use projection wizard find equal-area projection, entering extent coordinates used crop high seas area (xmin = 135, xmax = 155, ymin = 0, ymax = 6). use 10km square planning units data processing prioritization run reasonably fast (smaller planning units require time/ computer memory get data ) Pacific High Seas area planning grid raster Now planning grid, can get data conservation features (e.g. habitats) using oceandatr use spatial prioritization single command get_features(). set seamount buffer, area around seamount included part seamount, use 30km based since biodiversity known higher within distance seamount peaks (see ?get_seamounts_buffered info). Conservation features Pacific High Seas planning area","code":"high_seas <- get_boundary(type = \"high_seas\") pacific_hs_area_extent <- sf::st_bbox(c(xmin = 135, xmax = 155, ymin = 0, ymax = 6), crs = 4326) plot(sf::st_geometry(high_seas), main = \"High Seas\", col = \"royalblue3\", axes = TRUE, las = 1) plot(pacific_hs_area_extent %>% sf::st_as_sfc() %>% sf::st_cast(to = \"LINESTRING\"), col = \"red\", lwd=2, add = TRUE) country_names <- c(\"Indonesia\", \"Papua New Guinea\", \"Palau\", \"Micronesia\") eezs <- lapply(country_names, FUN = function(x) get_boundary(name = x) %>% dplyr::select(territory1) %>% dplyr::rename(name = territory1)) %>% do.call(rbind, .) %>% sf::st_cast(to = \"MULTIPOLYGON\") sf::sf_use_s2(FALSE) #turn off S2 to avoid errors pacific_hs <- high_seas %>% sf::st_crop(pacific_hs_area_extent) %>% sf::st_sf() %>% dplyr::mutate(name = \"Pacific High Seas area\") %>% dplyr::select(name) sf::sf_use_s2(TRUE) plot(rbind(sf::st_cast(pacific_hs, to = \"MULTIPOLYGON\"), eezs), axes = TRUE, main = NULL, key.pos = 4) pacific_hs_projection <- \"+proj=cea +lon_0=145 +lat_ts=3 +datum=WGS84 +units=m +no_defs\" pacific_hs_planning_grid <- get_grid(boundary = pacific_hs, crs = pacific_hs_projection, resolution = 10000) #get_grid returns a raster by default, so we can plot it using the terra package terra::plot(pacific_hs_planning_grid, col = \"grey70\") feature_set <- get_features(spatial_grid = pacific_hs_planning_grid, seamount_buffer = 30000) %>% oceandatr:::remove_empty_layers() #use this to remove raster layers that are empty terra::plot(feature_set, col = c(\"grey60\", \"royalblue\"), maxnl = terra::nlyr(feature_set), axes = FALSE, fun = function(x)terra::lines(pacific_hs %>% sf::st_transform(pacific_hs_projection))) #set maximum number of layers to plot to the same as the number of layers in the feature set"},{"path":"https://emlab-ucsb.github.io/oceandatr/articles/pacific_high_seas_example.html","id":"cost-data-global-fishing-watch-data","dir":"Articles","previous_headings":"","what":"Cost data: Global Fishing Watch data","title":"Pacific High Seas Example","text":"piece data needed spatial prioritization cost. terrestrial spatial planning, can actually monetary value buying land conservation. marine spatial planning, measures fishing, catch fishing effort, often used opportunity cost planning unit. Global Fishing Watch global fishing effort data, can accessed easily using get_gfw() function oceandatr (wrapper get_raster() function gfwr package). API key required, can easily generated cost; see gfwr website details. Map total apparent fishing effort 2022 Pacific High Seas area. Data Global Fishing Watch","code":"fishing_effort <- get_gfw(spatial_grid = pacific_hs_planning_grid, start_year = 2022, end_year = 2022, summarise = \"total_annual_effort\") %>% terra::subst(NA, 0.01) %>% #set NA values to zero otherwise they will be left out of the prioritization terra::mask(pacific_hs_planning_grid) %>% setNames(\"fishing_effort\") terra::plot(fishing_effort, fun = terra::lines(pacific_hs %>% sf::st_transform(pacific_hs_projection)), axes = FALSE)"},{"path":"https://emlab-ucsb.github.io/oceandatr/articles/pacific_high_seas_example.html","id":"run-a-simple-spatial-prioritization","dir":"Articles","previous_headings":"","what":"Run a simple spatial prioritization","title":"Pacific High Seas Example","text":"now data need create conservation problem solve get map priority areas conservation Pacific High Seas area. prioritization, need set targets much conservation feature must included prioritized areas. set 20%. Prioritization solution Pacific High Seas area. Black outlines seamounts.","code":"prob <- prioritizr::problem(x = fishing_effort, features = feature_set) %>% add_min_set_objective() %>% add_relative_targets(0.2) %>% #add_boundary_penalties(penalty = 0.00001) %>% add_binary_decisions() %>% add_lpsymphony_solver(verbose = FALSE) sol <- solve(prob) terra::plot(sol, main = \"Solution\", col = c(\"grey70\", \"green4\"), type = \"classes\", levels = c(\"Not selected\", \"Selected\"), fun = terra::lines(pacific_hs %>% sf::st_transform(pacific_hs_projection)), axes = FALSE, mar = c(3,3,2,6)+0.1) terra::plot(terra::as.polygons(feature_set[[\"seamounts\"]]), add=TRUE)"},{"path":"https://emlab-ucsb.github.io/oceandatr/articles/pacific_high_seas_example.html","id":"prioritization-with-patches","dir":"Articles","previous_headings":"","what":"Prioritization with patches","title":"Pacific High Seas Example","text":"ensure whole seamount areas area included solution, need use patchwise package pre-processing data use. prioritization result similar , whole seamount patches equal least 20% total seamount area included. Prioritization solution Pacific High Seas area, whole seamounts included. Black outlines seamounts.","code":"# Separate seamount data - we want to protect entire patches seamounts_rast <- feature_set[[\"seamounts\"]] features_rast <- feature_set[[names(feature_set)[names(feature_set) != \"seamounts\"]]] # Create seamount patches - seamount areas that touch are considered the same patch patches_rast <- patchwise::create_patches(seamounts_rast %>% terra::subst(0, NA)) #patchwise currently expects all non-patches to be NA, some subsituting non-seamounts, which are currently zeroes, with NAs # Create patches dataframe - this creates several constraints so that entire seamount units are protected together patches_df_rast <- patchwise::create_patch_df(spatial_grid = pacific_hs_planning_grid, features = features_rast, patches = patches_rast, costs = fishing_effort) #> [1] \"Processing patch 1 of 6\" #> [1] \"Processing patch 2 of 6\" #> [1] \"Processing patch 3 of 6\" #> [1] \"Processing patch 4 of 6\" #> [1] \"Processing patch 5 of 6\" #> [1] \"Processing patch 6 of 6\" # Create boundary matrix for prioritizr boundary_matrix_rast <- patchwise::create_boundary_matrix(spatial_grid = pacific_hs_planning_grid, patches = patches_rast, patch_df = patches_df_rast) # Create targets for protection - let's just do 20% for each feature (including 20% of whole seamounts) targets_rast <- patchwise::features_targets(targets = rep(0.2, (terra::nlyr(features_rast) + 1)), features = features_rast, pre_patches = seamounts_rast) # Add these targets to targets for protection for the \"constraints\" we introduced to protect entire seamount units constraints_rast <- patchwise::constraints_targets(feature_targets = targets_rast, patch_df = patches_df_rast) # Run the prioritization problem_rast <- prioritizr::problem(x = patches_df_rast, features = constraints_rast$feature, cost_column = \"fishing_effort\") %>% prioritizr::add_min_set_objective() %>% prioritizr::add_manual_targets(constraints_rast) %>% prioritizr::add_binary_decisions() %>% #prioritizr::add_boundary_penalties(penalty = 0.0001, data = boundary_matrix_rast) %>% prioritizr::add_lpsymphony_solver() # Solve the prioritization solution_rast <- solve(problem_rast) # Convert the prioritization into a more digestible format result_rast <- patchwise::convert_solution(solution = solution_rast, patch_df = patches_df_rast, spatial_grid = pacific_hs_planning_grid) # Show the results terra::plot(result_rast, main = \"Solution\", col = c(\"grey70\", \"green4\"), type = \"classes\", levels = c(\"Not selected\", \"Selected\"), fun = terra::lines(pacific_hs %>% sf::st_transform(pacific_hs_projection)), axes = FALSE, mar = c(3,3,2,6)+0.1) terra::plot(terra::as.polygons(seamounts_rast), add=TRUE)"},{"path":"https://emlab-ucsb.github.io/oceandatr/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Jason Flower. Author, maintainer.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Flower J (2025). oceandatr: Ocean Data Access. R package version 0.2.0, https://emlab-ucsb.github.io/oceandatr/.","code":"@Manual{, title = {oceandatr: Ocean Data Access}, author = {Jason Flower}, year = {2025}, note = {R package version 0.2.0}, url = {https://emlab-ucsb.github.io/oceandatr/}, }"},{"path":"https://emlab-ucsb.github.io/oceandatr/index.html","id":"oceandatr-","dir":"","previous_headings":"","what":"Ocean Data Access","title":"Ocean Data Access","text":"oceandatr aims provide simple functions retrieving ocean data. Using associated package spatialgridr, can also easily grid data, useful various purposes including spatial conservation prioritization. Fish images logo modified original Tracey Saxby, Integration Application Network","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Ocean Data Access","text":"can install oceandatr GitHub :","code":"if (!require(remotes)) install.packages(\"remotes\") #might need to increase timeout as it is a large package options(timeout = 9999) remotes::install_github(\"emlab-ucsb/oceandatr\")"},{"path":"https://emlab-ucsb.github.io/oceandatr/index.html","id":"getting-gridded-ocean-data","dir":"","previous_headings":"","what":"Getting gridded ocean data","title":"Ocean Data Access","text":"","code":"#load oceandatr package library(oceandatr)"},{"path":"https://emlab-ucsb.github.io/oceandatr/index.html","id":"obtain-an-eez-for-an-area-of-interest","dir":"","previous_headings":"","what":"Obtain an EEZ for an area of interest","title":"Ocean Data Access","text":"First need boundary area interested . can use get_boundary() function, imported spatialgridr, get boundary land ocean. example get Bermuda’s Exclusive Economic Zone (EEZ)","code":"bermuda_eez <- get_boundary(name = \"Bermuda\") #plot to check we have Bermuda's EEZ plot(bermuda_eez[1], col = \"lightblue\", main=NULL, axes=TRUE)"},{"path":"https://emlab-ucsb.github.io/oceandatr/index.html","id":"get-a-grid","dir":"","previous_headings":"","what":"Get a grid","title":"Ocean Data Access","text":"going get gridded data. create grid Bermuda, use get_grid(). need provide suitable projection area interested , https://projectionwizard.org useful purpose. Standard projections used countries can also found https://epsg.io/ searching country name. spatial planning, equal area projections normally best. bounding box coordinates area interest can found using sf::st_bbox(bermuda_eez) can used generate coordinate reference system (CRS) projection wizard coordinates entered ‘Geographic extent’ map box drawn around bounding box area interest. projection can copied pasted pop-box clicking ‘WKT’ ‘PROJ’. brevity, using PROJ string, WKT now generally preferred. projection needs placed quotation marks follows: can now create grid Bermuda’s EEZ using get_grid(). Along projection found , need set resolution: wide high grid cell , case metres. units depend crs can found using e.g. sf::st_crs(projection_bermuda, parameters = TRUE)$units_gdal raster covers Bermuda’s EEZ. grid cells small see plotted , coarser grid (lower resolution) visualized can see grid cells look like.","code":"projection_bermuda <- '+proj=laea +lon_0=-64.8108333 +lat_0=32.3571917 +datum=WGS84 +units=m +no_defs' bermuda_grid <- get_grid(boundary = bermuda_eez, resolution = 5000, crs = projection_bermuda) #project the eez into same projection as grid for plotting bermuda_eez_projected <- bermuda_eez %>% sf::st_transform(crs = projection_bermuda) %>% sf::st_geometry() #plot the grid terra::plot(bermuda_grid, col = \"gold3\", axes = FALSE, legend = FALSE) plot(bermuda_eez_projected, add=TRUE) bermuda_grid_coarse <- get_grid(boundary = bermuda_eez, resolution = 20000, crs = projection_bermuda) plot(bermuda_eez_projected, axes = FALSE) terra::plot(terra::as.polygons(bermuda_grid_coarse, dissolve = FALSE), add=TRUE)"},{"path":"https://emlab-ucsb.github.io/oceandatr/index.html","id":"get-bathymetry","dir":"","previous_headings":"","what":"Get bathymetry","title":"Ocean Data Access","text":"Now grid, can get data. key piece data bathymetry. user bathymetry data area interest already, can pass file path function grid data using supplied spatial grid. file path provided, function extract bathymetry data area ETOPO 2022 Global Relief model using function borrowed marmap package.","code":"bathymetry <- get_bathymetry(spatial_grid = bermuda_grid, classify_bathymetry = FALSE) #> This may take seconds to minutes, depending on grid size terra::plot(bathymetry, col = hcl.colors(n=255, \"Blues\"), axes = FALSE) plot(bermuda_eez_projected, add=TRUE)"},{"path":"https://emlab-ucsb.github.io/oceandatr/index.html","id":"depth-classification","dir":"","previous_headings":"Get bathymetry","what":"Depth classification","title":"Ocean Data Access","text":"ocean can classified 5 depth zones: 0 - 200m: Epipelagic zone 200 - 1000m: Mesopelagic zone 1000 - 4000m: Bathypelagic zone 4000 - 6000m: Abyssopelagic zone 6000m+: Hadopelagic zone can get depth zones Bermuda simply setting classify_bathymetry argument get_bathymetry TRUE.","code":"depth_zones <- get_bathymetry(spatial_grid = bermuda_grid, classify_bathymetry = TRUE) #> This may take seconds to minutes, depending on grid size #value of 1 indicates that depth zone is present terra::plot(depth_zones, col = c(\"grey60\", \"navyblue\"), axes = FALSE, fun = function(){terra::lines(terra::vect(bermuda_eez_projected))})"},{"path":"https://emlab-ucsb.github.io/oceandatr/index.html","id":"get-geomorphological-data","dir":"","previous_headings":"","what":"Get geomorphological data","title":"Ocean Data Access","text":"seafloor valleys, plains geomorphological features just land. data come Harris et al. 2014, Geomorphology Oceans available download https://www.bluehabitats.org, depth classifications (can created using get_bathymetry()) seamounts (can retrieved recent dataset using get_seamounts()) included package.","code":"geomorphology <- get_geomorphology(spatial_grid = bermuda_grid) %>% remove_empty_layers() #can remove any empty layers so we don't have so many layers to plot #brown colour indicates that geomorphological feature is present terra::plot(geomorphology, col = data.frame(c(0,1), c(\"grey60\", \"sienna\")), axes = FALSE, legend = FALSE, fun = function(){terra::lines(terra::vect(bermuda_eez_projected))})"},{"path":"https://emlab-ucsb.github.io/oceandatr/index.html","id":"get-knolls-data","dir":"","previous_headings":"","what":"Get knolls data","title":"Ocean Data Access","text":"Knolls another geomorphological feature, ‘small’ seamounts, classified seamounts 200 1000m higher surrounding seafloor Morato et al. 2008. Data knoll base area data Yesson et al. 2011.","code":"knolls <- get_knolls(spatial_grid = bermuda_grid) #value of 1 indicates that knolls are present terra::plot(knolls, col = c(\"grey60\", \"grey20\"), axes = FALSE) plot(bermuda_eez_projected, add=TRUE)"},{"path":"https://emlab-ucsb.github.io/oceandatr/index.html","id":"get-seamount-areas","dir":"","previous_headings":"","what":"Get seamount areas","title":"Ocean Data Access","text":"Seamounts, classified peaks least 1000m higher surrounding seafloor Morato et al. 2008. data Yesson et al. 2021. peak buffered distance specified function call. units buffer units spatial grid, can checked using, e.g. sf::st_crs(bermuda_grid, parameters = TRUE)$units_gdal","code":"#spatial grid units are metres, so set buffer to 30000 m = 30 km seamounts <- get_seamounts(spatial_grid = bermuda_grid, buffer = 30000) #value of 1 indicates that seamount is present terra::plot(seamounts, col = c( \"grey60\", \"saddlebrown\"), axes = FALSE) plot(bermuda_eez_projected, add=TRUE)"},{"path":"https://emlab-ucsb.github.io/oceandatr/index.html","id":"habitat-suitability-models","dir":"","previous_headings":"","what":"Habitat suitability models","title":"Ocean Data Access","text":"Retrieve habitat suitability data 3 deep water coral groups: Antipatharia: Habitats associated increased biodiversity invertebrate vertebrate species; global distributions modeled Yesson et al. (2017) Cold water coral: Important habitats nursery areas many species; global distributions modeled Davies Guinotte (2011) Octocoral: Important habitats invertebrates, groundfish, rockfish species; global distributions modeled Yesson et al. (2012)","code":"coral_habitat <- get_coral_habitat(spatial_grid = bermuda_grid) #show the seamounts areas on the plot: coral habitat is often on seamounts which are shallower than surrounding ocean floor #value of 1 indicates that coral is present terra::plot(coral_habitat, col = c(\"grey60\", \"coral\"), axes = FALSE, fun = function()terra::lines(terra::as.polygons(seamounts, dissolve = TRUE), col = \"orangered4\"))"},{"path":"https://emlab-ucsb.github.io/oceandatr/index.html","id":"environmental-regions","dir":"","previous_headings":"","what":"Environmental Regions","title":"Ocean Data Access","text":"Bioregions often included spatial planning, available bioregional classifications either coarse detailed useful planning EEZ level. Borrowing methods Magris et al. 2020, use spatial clustering biophysical environmental data Bio-Oracle, create ‘environmental regions’. Biophysical conditions within environmental region similar areas outside region, though differences may small. Diagnostic boxplots PCA shown show_plots = TRUE. biophysical data ocean surface data period 2010 - 2020: Chlorophyll concentration (mean, mg/ m3) Dissolved oxygen concentration (mean) Nitrate concentration (mean, mmol/ m3) pH (mean) Phosphate concentration (mean, mmol/ m3) total Phytoplankton (primary productivity; mean, mmol/ m3) Salinity (mean) Sea surface temperature (max, degree C) Sea surface temperature (mean, degree C) Sea surface temperature (min, degree C) Silicate concentration (mean, mmol/ m3)","code":"#set number of clusters to 3 to reduce runtime and memory usage enviro_regions <- get_enviro_regions(spatial_grid = bermuda_grid, show_plots = TRUE, num_clusters = 3) #value of 1 indicates that environmental region is present terra::plot(enviro_regions, col = c(\"grey60\", \"forestgreen\"), axes = FALSE, fun = function(){terra::lines(terra::vect(bermuda_eez_projected))})"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_bathymetry.html","id":null,"dir":"Reference","previous_headings":"","what":"Get bathymetry data — get_bathymetry","title":"Get bathymetry data — get_bathymetry","text":"Get bathymetry data area ETOPO 2022 Global Relief model. data already downloaded locally, user can specify file path dataset. Data can classified depth zones setting classify_bathymetry = TRUE","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_bathymetry.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get bathymetry data — get_bathymetry","text":"","code":"get_bathymetry( spatial_grid = NULL, raw = FALSE, classify_bathymetry = TRUE, above_sea_level_isNA = FALSE, name = \"bathymetry\", bathymetry_data_filepath = NULL, resolution = 1, keep = FALSE, path = NULL, download_timeout = 300, antimeridian = NULL )"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_bathymetry.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get bathymetry data — get_bathymetry","text":"spatial_grid sf terra::rast() grid, e.g. created using get_grid(). Alternatively, raw data required, sf polygon can provided, e.g. created using get_boundary(), set raw = TRUE. raw logical TRUE, spatial_grid sf polygon, raw data polygon(s) returned classify_bathymetry logical; whether classify bathymetry depth zones. Original bathymetry data can classified raw = TRUE spatial_grid sf polygon. above_sea_level_isNA logical; whether set bathymetry (elevation) data values sea level (.e. greater equal zero) NA (TRUE) zero (FALSE) name string; name raster column sf object returned bathymetry_data_filepath string; file path (including file name extension) bathymetry raster data saved locally resolution numeric; resolution (minutes) data pull ETOPO 2022 Global Relief model. Values less 1 can 0.5 (30 arc seconds) 0.25 (15 arc seconds) keep logical; whether save bathymetry data locally path string; file path like save bathymetry data download_timeout numeric; maximum number seconds query NOAA website allowed run antimeridian spatial_grid span antimeridian? , set TRUE, otherwise set FALSE. set NULL (default) function try check spatial_grid spans antimeridian set appropriately.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_bathymetry.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get bathymetry data — get_bathymetry","text":"classify_bathymetry = FALSE, bathymetry data spatial_grid supplied, original raster file resolution raw = TRUE. classify_bathymetry = TRUE multi-layer raster sf object one zone column returned, depending spatial_grid format. classify_bathymetry = TRUE raw = TRUE (case spatial_grid sf polygon), raw raster bathymetry data classified depth zones.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_bathymetry.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get bathymetry data — get_bathymetry","text":"Extracts bathymetry data area_polygon, spatial_grid supplied, gridded bathymetry returned. Data can classified depth zones setting classify_bathymetry = TRUE. Depths classified follows: Epipelagic Zone: 0-200 m depth Mesopelagic Zone: 200-1000 m depth Bathypelagic Zone: 1000-4000 m depth Abyssopelagic Zone: 4000-6000 m depth Hadopelagic Zone: 6000+ m depth user downloaded bathymetry data area interest, example GEBCO (https://www.gebco.net), can pass file path function bathymetry_data_filepath. file path provided, function extract bathymetry data area ETOPO 2022 Global Relief model served NOAA (https://www.ncei.noaa.gov/products/etopo-global-relief-model).","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_bathymetry.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get bathymetry data — get_bathymetry","text":"","code":"# Get EEZ data first bermuda_eez <- get_boundary(name = \"Bermuda\") # Get raw bathymetry data, not classified into depth zones bathymetry <- get_bathymetry(spatial_grid = bermuda_eez, raw = TRUE, classify_bathymetry = FALSE) #> This may take seconds to minutes, depending on grid size terra::plot(bathymetry) # Get depth zones in spatial_grid bermuda_grid <- get_grid(boundary = bermuda_eez, crs = '+proj=laea +lon_0=-64.8108333 +lat_0=32.3571917 +datum=WGS84 +units=m +no_defs', resolution = 20000) depth_zones <- get_bathymetry(spatial_grid = bermuda_grid) #> This may take seconds to minutes, depending on grid size terra::plot(depth_zones) #It is also possible to get the raw bathymetry data in gridded format by setting raw = FALSE and classify_bathymetry = FALSE bermuda_grid_sf <- get_grid(boundary = bermuda_eez, crs = '+proj=laea +lon_0=-64.8108333 +lat_0=32.3571917 +datum=WGS84 +units=m +no_defs', resolution = 20000, output = \"sf_hex\") gridded_bathymetry <- get_bathymetry(spatial_grid = bermuda_grid_sf, classify_bathymetry = FALSE) #> This may take seconds to minutes, depending on grid size #> | | | 0% | | | 1% | |= | 1% | |= | 2% | |== | 2% | |== | 3% | |== | 4% | |=== | 4% | |=== | 5% | |==== | 5% | |==== | 6% | |===== | 6% | |===== | 7% | |===== | 8% | |====== | 8% | |====== | 9% | |======= | 9% | |======= | 10% | |======= | 11% | |======== | 11% | |======== | 12% | |========= | 12% | |========= | 13% | |========= | 14% | |========== | 14% | |========== | 15% | |=========== | 15% | |=========== | 16% | |============ | 16% | |============ | 17% | |============ | 18% | |============= | 18% | |============= | 19% | |============== | 19% | |============== | 20% | |============== | 21% | |=============== | 21% | |=============== | 22% | |================ | 22% | |================ | 23% | |================ | 24% | |================= | 24% | |================= | 25% | |================== | 25% | |================== | 26% | |=================== | 26% | |=================== | 27% | |=================== | 28% | |==================== | 28% | |==================== | 29% | |===================== | 29% | |===================== | 30% | |===================== | 31% | |====================== | 31% | |====================== | 32% | |======================= | 32% | |======================= | 33% | |======================= | 34% | |======================== | 34% | |======================== | 35% | |========================= | 35% | |========================= | 36% | |========================== | 36% | |========================== | 37% | |========================== | 38% | |=========================== | 38% | |=========================== | 39% | |============================ | 39% | |============================ | 40% | |============================ | 41% | |============================= | 41% | |============================= | 42% | |============================== | 42% | |============================== | 43% | |============================== | 44% | |=============================== | 44% | |=============================== | 45% | |================================ | 45% | |================================ | 46% | |================================= | 46% | |================================= | 47% | |================================= | 48% | |================================== | 48% | |================================== | 49% | |=================================== | 49% | |=================================== | 50% | |=================================== | 51% | |==================================== | 51% | |==================================== | 52% | |===================================== | 52% | |===================================== | 53% | |===================================== | 54% | |====================================== | 54% | |====================================== | 55% | |======================================= | 55% | |======================================= | 56% | |======================================== | 56% | |======================================== | 57% | |======================================== | 58% | |========================================= | 58% | |========================================= | 59% | |========================================== | 59% | |========================================== | 60% | |========================================== | 61% | |=========================================== | 61% | |=========================================== | 62% | |============================================ | 62% | |============================================ | 63% | |============================================ | 64% | |============================================= | 64% | |============================================= | 65% | |============================================== | 65% | |============================================== | 66% | |=============================================== | 66% | |=============================================== | 67% | |=============================================== | 68% | |================================================ | 68% | |================================================ | 69% | |================================================= | 69% | |================================================= | 70% | |================================================= | 71% | |================================================== | 71% | |================================================== | 72% | |=================================================== | 72% | |=================================================== | 73% | |=================================================== | 74% | |==================================================== | 74% | |==================================================== | 75% | |===================================================== | 75% | |===================================================== | 76% | |====================================================== | 76% | |====================================================== | 77% | |====================================================== | 78% | |======================================================= | 78% | |======================================================= | 79% | |======================================================== | 79% | |======================================================== | 80% | |======================================================== | 81% | |========================================================= | 81% | |========================================================= | 82% | |========================================================== | 82% | |========================================================== | 83% | |========================================================== | 84% | |=========================================================== | 84% | |=========================================================== | 85% | |============================================================ | 85% | |============================================================ | 86% | |============================================================= | 86% | |============================================================= | 87% | |============================================================= | 88% | |============================================================== | 88% | |============================================================== | 89% | |=============================================================== | 89% | |=============================================================== | 90% | |=============================================================== | 91% | |================================================================ | 91% | |================================================================ | 92% | |================================================================= | 92% | |================================================================= | 93% | |================================================================= | 94% | |================================================================== | 94% | |================================================================== | 95% | |=================================================================== | 95% | |=================================================================== | 96% | |==================================================================== | 96% | |==================================================================== | 97% | |==================================================================== | 98% | |===================================================================== | 98% | |===================================================================== | 99% | |======================================================================| 99% | |======================================================================| 100% plot(gridded_bathymetry)"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_coral_habitat.html","id":null,"dir":"Reference","previous_headings":"","what":"Get coral habitat suitability data — get_coral_habitat","title":"Get coral habitat suitability data — get_coral_habitat","text":"function extracts coral habitat suitability creates presence (1) absence (0) grids three groups deep-water coral species: antipatharia, cold water corals, octocorals.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_coral_habitat.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get coral habitat suitability data — get_coral_habitat","text":"","code":"get_coral_habitat( spatial_grid = NULL, raw = FALSE, antipatharia_threshold = 22, octocoral_threshold = 2, antimeridian = NULL )"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_coral_habitat.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get coral habitat suitability data — get_coral_habitat","text":"spatial_grid sf terra::rast() grid, e.g. created using get_grid(). Alternatively, raw data required, sf polygon can provided, e.g. created using get_boundary(), set raw = TRUE. raw logical TRUE, spatial_grid sf polygon, raw data polygon(s) returned antipatharia_threshold numeric 0 100; threshold value habitat suitability antipatharia corals considered present (default 22, defined Yesson et al., 2017) octocoral_threshold numeric 0 7; threshold value many species (7) predicted present area octocorals considered present (default 2) antimeridian spatial_grid span antimeridian? , set TRUE, otherwise set FALSE. set NULL (default) function try check spatial_grid spans antimeridian set appropriately.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_coral_habitat.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get coral habitat suitability data — get_coral_habitat","text":"area_polygon supplied, raster stack coral habitat suitability data returned; note raw habitat suitability/ . species values. spatial_grid supplied, raster stack sf gridded coral habitat presence/ absence data returned, depending spatial_grid format.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_coral_habitat.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get coral habitat suitability data — get_coral_habitat","text":"Habitat suitability data global Maxent species distribution models following species groups: Antipatharia: global extent black coral habiatat suitability modelled using Maxent. antipatharia habitat suitability converted presence/absence map \"choosing threshold value habitat suitability based maximum sum sensitivity specificity (threshold mss = 0.23)\" (Yesson et al. 2017). threshold can altered via function input. Data Yesson et al. 2017. Cold water corals: global habitat suitability five species Scleractinia modelled using Maxent. Presence defined using Maxent values lowest 10 percent values. Data Davies Guinotte 2011. Octocorals: global habitat suitability modelled 7 species cold-water octocoral found deeper 50m. Data described Yesson et al. 2012: \"consensus/summary map incorporating seven octocoral suborders constructed generating binary presence/absence maps model outputs indicating areas high suitability using score threshold maximized sum specificity sensitivity based validation data (Carroll, 2010). binary layers summed generate layer containing number octocoral suborders predicted present per cell.\"","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_coral_habitat.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get coral habitat suitability data — get_coral_habitat","text":"","code":"# Get EEZ data first bermuda_eez <- get_boundary(name = \"Bermuda\") # Get raw coral habitat data coral_habitat <- get_coral_habitat(spatial_grid = bermuda_eez, raw = TRUE) terra::plot(coral_habitat) # Get gridded coral habitat data bermuda_grid <- get_grid(boundary = bermuda_eez, crs = '+proj=laea +lon_0=-64.8108333 +lat_0=32.3571917 +datum=WGS84 +units=m +no_defs', resolution = 10000) bermuda_coral_gridded <- get_coral_habitat(spatial_grid = bermuda_grid) terra::plot(bermuda_coral_gridded)"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_dist.html","id":null,"dir":"Reference","previous_headings":"","what":"Get distance to port or shore for a spatial grid — get_dist","title":"Get distance to port or shore for a spatial grid — get_dist","text":"Calculates distance shore, port anchorage grid cell provided spatial grid. Spatial grid can terra::rast() sf format.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_dist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get distance to port or shore for a spatial grid — get_dist","text":"","code":"get_dist( spatial_grid, dist_to = \"shore\", raw = FALSE, inverse = FALSE, name = NULL, antimeridian = NULL )"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_dist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get distance to port or shore for a spatial grid — get_dist","text":"spatial_grid sf terra::rast() grid, e.g. created using get_grid(). Alternatively, raw data required, sf polygon can provided, e.g. created using get_boundary(), set raw = TRUE. dist_to character data use calculate distance . Default \"shore\" (Natural Earth land polygons); possible values \"ports\" (WPI Ports), \"anchorages_land_masked\", \"anchorages_grouped\" \"anchorages_all\" (GFW anchorages). raw logical set TRUE retrieve raw shore, port anchorage data within extent spatial_grid. Note closest shore, port anchorage may outside extent. inverse logical set TRUE get inverse distance, .e. highest values become lowest vice versa. Can useful result used proxy fishing activity, closer grid cell port shore, fishing activity might . Default FALSE. name string; name raster column sf object returned antimeridian spatial_grid span antimeridian? , set TRUE, otherwise set FALSE. set NULL (default) function try check spatial_grid spans antimeridian set appropriately.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_dist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get distance to port or shore for a spatial grid — get_dist","text":"terra::rast sf object (type spatial_grid input) distance shore grid cell.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_dist.html","id":"shore","dir":"Reference","previous_headings":"","what":"Shore","title":"Get distance to port or shore for a spatial grid — get_dist","text":"Natural Earth high resolution land polygons used shoreline downloaded Natural Earth website (https://www.naturalearthdata.com/downloads/10m-physical-vectors/), internet connection required.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_dist.html","id":"ports","dir":"Reference","previous_headings":"","what":"Ports","title":"Get distance to port or shore for a spatial grid — get_dist","text":"Port locations downloaded directly World Port Index (Pub 150): https://msi.nga.mil/Publications/WPI.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_dist.html","id":"anchorages","dir":"Reference","previous_headings":"","what":"Anchorages","title":"Get distance to port or shore for a spatial grid — get_dist","text":"anchorages data Global Fishing Watch identifies anchorages anywhere vessels AIS remain stationary 12 hours (see https://globalfishingwatch.org/datasets--code-anchorages/). results large number points (~167,000). Calculating distance points grid cell computationally expensive. Anchorages close together names, reduce number anchorages, aggregated iso3 code (country code) label (name) mean longitude latitude coordinates obtained get one anchorage point per name country. data can used specifying dist_to = \"anchorages_grouped\". reduce number points, anchorages within countries' land boundaries, e.g. along rivers, can removed. buffering Natural Earth land boundaries 10km inland avoid cutting coastal anchorages fall within land boundary, due inaccuracies Natural Earth land boundaries, e.g. islands small scale coastlines, masking points fall within resulting polygons. data can used specifying dist_to = \"anchorages_land_masked\". full anchorages dataset can used specifying dist_to = \"anchorages_all\", option may take long time calculate / cause system hang.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_dist.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get distance to port or shore for a spatial grid — get_dist","text":"","code":"# Get some EEZ data first fiji_eez <- get_boundary(name = \"Fiji\") # Get a raster spatial grid for Fiji fiji_grid <- get_grid(boundary = fiji_eez, crs = 32760, resolution = 20000) #get distance from shore for each cell in the raster dist_from_shore_rast <- get_dist(fiji_grid) terra::plot(dist_from_shore_rast) #get distance to ports dist_ports <- get_dist(fiji_grid, dist_to = \"ports\") terra::plot(dist_ports) #get distance to anchorages, as defined by Global Fishing Watch data dist_anchorages <- get_dist(fiji_grid, dist_to = \"anchorages_land_masked\") terra::plot(dist_anchorages)"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_ecoregion.html","id":null,"dir":"Reference","previous_headings":"","what":"Get ecoregions — get_ecoregion","title":"Get ecoregions — get_ecoregion","text":"Gets ecoregion data spatial grid polygon","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_ecoregion.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get ecoregions — get_ecoregion","text":"","code":"get_ecoregion( spatial_grid = NULL, raw = FALSE, type = \"MEOW\", antimeridian = NULL )"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_ecoregion.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get ecoregions — get_ecoregion","text":"spatial_grid sf terra::rast() grid, e.g. created using get_grid(). Alternatively, raw data required, sf polygon can provided, e.g. created using get_boundary(), set raw = TRUE. raw logical TRUE, spatial_grid sf polygon, raw data polygon(s) returned type character ecoregion type required? Default \\\"MEOW\\\" (Marine Ecosystems World); possible values \\\"Longhurst\\\" \\\"LME\\\" antimeridian spatial_grid span antimeridian? , set TRUE, otherwise set FALSE. set NULL (default) function try check spatial_grid spans antimeridian set appropriately.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_ecoregion.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get ecoregions — get_ecoregion","text":"gridded data, multi-layer raster object, sf object depending spatial_grid format. raw = TRUE sf object Ecoregion.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_ecoregion.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get ecoregions — get_ecoregion","text":"Following ecoregions can obtained: Marine Ecosystems World dataset Longhurst Provinces Large Marine Ecosystems World data downloaded via mregions2 R package function mregions2::mrp_get(), information data can found Marine Regions website","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_ecoregion.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get ecoregions — get_ecoregion","text":"","code":"#' # Get EEZ data first bermuda_eez <- get_boundary(name = \"Bermuda\") #> Cache is fresh. Reading: /tmp/RtmpGtftbr/eez-2205f12f/eez.shp #> (Last Modified: 2025-01-09 06:02:16.566641) # Get Marine Ecoregions of the World data ecoregions <- get_ecoregion(spatial_grid = bermuda_eez, raw = TRUE) #> Spherical geometry (s2) switched off #> although coordinates are longitude/latitude, st_intersection assumes that they #> are planar #> Warning: attribute variables are assumed to be spatially constant throughout all geometries #> Spherical geometry (s2) switched on # Get Longhurst Provinces in a spatial grid bermuda_grid <- get_grid(boundary = bermuda_eez, crs = '+proj=laea +lon_0=-64.8108333 +lat_0=32.3571917 +datum=WGS84 +units=m +no_defs', resolution = 20000) longhurst_gridded <- get_ecoregion(spatial_grid = bermuda_grid, type = \"Longhurst\") #> Spherical geometry (s2) switched off #> although coordinates are longitude/latitude, st_intersection assumes that they #> are planar #> Warning: attribute variables are assumed to be spatially constant throughout all geometries #> Spherical geometry (s2) switched on"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_enviro_regions.html","id":null,"dir":"Reference","previous_headings":"","what":"Create environmental regions for area of interest — get_enviro_regions","title":"Create environmental regions for area of interest — get_enviro_regions","text":"function gets Bio-Oracle environmental data spatial grid can create environmental regions using k-means clustering. idea clustering comes Magris et al. 2020. number environmental regions can specified directly, using num_clusters, function can also find 'optimal' number clusters using NbClust() NbClust package.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_enviro_regions.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create environmental regions for area of interest — get_enviro_regions","text":"","code":"get_enviro_regions( spatial_grid = NULL, raw = FALSE, enviro_regions = TRUE, show_plots = FALSE, num_clusters = NULL, max_num_clusters = 6, antimeridian = NULL, sample_size = 5000, num_samples = 5, num_cores = 1, custom_seed = 1234 )"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_enviro_regions.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create environmental regions for area of interest — get_enviro_regions","text":"spatial_grid sf terra::rast() grid, e.g. created using get_grid(). Alternatively, raw data required, sf polygon can provided, e.g. created using get_boundary(), set raw = TRUE. raw logical TRUE, spatial_grid sf polygon, raw Bio-Oracle environmental data polygon(s) returned, unless enviro_regions = TRUE, case raw data classified environmental regions enviro_regions logical TRUE, environmental regions created. FALSE gridded Bio-Oracle data returned show_plots logical; whether show boxplots environmental variable environmental region (default FALSE) num_clusters numeric; number environmental regions cluster data - used clustering algorithm necessary (default NULL) max_num_clusters numeric; maximum number environmental regions try using clustering algorithm (default 6) antimeridian spatial_grid span antimeridian? , set TRUE, otherwise set FALSE. set NULL (default) function try check spatial_grid spans antimeridian set appropriately. sample_size numeric; default 5000. Larger sample sizes quickly consume memory (>10GB) used caution. num_samples numeric; default 5, resulted good consensus optimal number clusters testing. num_cores numeric; default 1. Multi-core sampling supported package parallel installed, aware increasing number cores also increase memory required. custom_seed numeric; default 1234, custom seed can supplied desired.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_enviro_regions.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create environmental regions for area of interest — get_enviro_regions","text":"enviro_regions = FALSE, Bio-Oracle data spatial_grid supplied, original raster file resolution raw = TRUE. enviro_regions = TRUE multi-layer raster sf object one environmental region column/ layer returned, depending spatial_grid format. enviro_regions = TRUE raw = TRUE (case spatial_grid sf polygon), raw Bio-Oracle data classified environmental zones.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_enviro_regions.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create environmental regions for area of interest — get_enviro_regions","text":"environmental data used clustering sea surface measurements period 2010 - 2020: Chlorophyll concentration (mean, mg/ m3) Dissolved oxygen concentration (mean) Nitrate concentration (mean, mmol/ m3) pH (mean) Phosphate concentration (mean, mmol/ m3) total Phytoplankton (primary productivity; mean, mmol/ m3) Salinity (mean) Sea surface temperature (max, degree C) Sea surface temperature (mean, degree C) Sea surface temperature (min, degree C) Silicate concentration (mean, mmol/ m3) full details Bio-Oracle data see Assis et al. 2024. number planning units/ cells clustering exceeds ~ 10,000, amount computer memory required find optimal number clusters using NbClust::NbClust() exceeds 10GB, repeated sampling used find consensus number clusters. Sensible defaults NbClust() provided, namely sample_size = 5000, num_samples = 5, max_num_clusters = 6 can customised desired, though see parameter descriptions words warning. Parallel processing offered specifying num_cores >1 (must integer), though package parallel must installed (included R installations). find number available cores systems run parallel::detectCores().","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_enviro_regions.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create environmental regions for area of interest — get_enviro_regions","text":"","code":"# Get EEZ data first bermuda_eez <- get_boundary(name = \"Bermuda\") #> Cache is fresh. Reading: /tmp/RtmpGtftbr/eez-2205f12f/eez.shp #> (Last Modified: 2025-01-09 06:02:16.566641) # Get raw Bio-Oracle environmental data for Bermuda enviro_data <- get_enviro_regions(spatial_grid = bermuda_eez, raw = TRUE, enviro_regions = FALSE) #> Selected dataset chl_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/chl_baseline_2000_2018_depthsurf.html #> Selected 1 variables: chl_mean #> Selected dataset o2_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/o2_baseline_2000_2018_depthsurf.html #> Selected 1 variables: o2_mean #> Selected dataset no3_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/no3_baseline_2000_2018_depthsurf.html #> Selected 1 variables: no3_mean #> Selected dataset thetao_baseline_2000_2019_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/thetao_baseline_2000_2019_depthsurf.html #> Selected 1 variables: thetao_min #> Selected dataset thetao_baseline_2000_2019_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/thetao_baseline_2000_2019_depthsurf.html #> Selected 1 variables: thetao_mean #> Selected dataset thetao_baseline_2000_2019_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/thetao_baseline_2000_2019_depthsurf.html #> Selected 1 variables: thetao_max #> Selected dataset ph_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/ph_baseline_2000_2018_depthsurf.html #> Selected 1 variables: ph_mean #> Selected dataset po4_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/po4_baseline_2000_2018_depthsurf.html #> Selected 1 variables: po4_mean #> Selected dataset so_baseline_2000_2019_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/so_baseline_2000_2019_depthsurf.html #> Selected 1 variables: so_mean #> Selected dataset si_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/si_baseline_2000_2018_depthsurf.html #> Selected 1 variables: si_mean #> Selected dataset phyc_baseline_2000_2020_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/phyc_baseline_2000_2020_depthsurf.html #> Selected 1 variables: phyc_mean terra::plot(enviro_data) # Get gridded Bio-Oracle data for Bermuda: bermuda_grid <- get_grid(boundary = bermuda_eez, crs = '+proj=laea +lon_0=-64.8108333 +lat_0=32.3571917 +datum=WGS84 +units=m +no_defs', resolution = 20000) enviro_data_gridded <- get_enviro_regions(spatial_grid = bermuda_grid, raw = FALSE, enviro_regions = FALSE) #> Selected dataset chl_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/chl_baseline_2000_2018_depthsurf.html #> Selected 1 variables: chl_mean #> Selected dataset o2_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/o2_baseline_2000_2018_depthsurf.html #> Selected 1 variables: o2_mean #> Selected dataset no3_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/no3_baseline_2000_2018_depthsurf.html #> Selected 1 variables: no3_mean #> Selected dataset thetao_baseline_2000_2019_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/thetao_baseline_2000_2019_depthsurf.html #> Selected 1 variables: thetao_min #> Selected dataset thetao_baseline_2000_2019_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/thetao_baseline_2000_2019_depthsurf.html #> Selected 1 variables: thetao_mean #> Selected dataset thetao_baseline_2000_2019_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/thetao_baseline_2000_2019_depthsurf.html #> Selected 1 variables: thetao_max #> Selected dataset ph_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/ph_baseline_2000_2018_depthsurf.html #> Selected 1 variables: ph_mean #> Selected dataset po4_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/po4_baseline_2000_2018_depthsurf.html #> Selected 1 variables: po4_mean #> Selected dataset so_baseline_2000_2019_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/so_baseline_2000_2019_depthsurf.html #> Selected 1 variables: so_mean #> Selected dataset si_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/si_baseline_2000_2018_depthsurf.html #> Selected 1 variables: si_mean #> Selected dataset phyc_baseline_2000_2020_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/phyc_baseline_2000_2020_depthsurf.html #> Selected 1 variables: phyc_mean terra::plot(enviro_data_gridded) # Get 3 environmental regions for Bermuda bermuda_enviro_regions <- get_enviro_regions(spatial_grid = bermuda_grid, raw = FALSE, enviro_regions = TRUE, num_clusters = 3) #> Selected dataset chl_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/chl_baseline_2000_2018_depthsurf.html #> Selected 1 variables: chl_mean #> Selected dataset o2_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/o2_baseline_2000_2018_depthsurf.html #> Selected 1 variables: o2_mean #> Selected dataset no3_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/no3_baseline_2000_2018_depthsurf.html #> Selected 1 variables: no3_mean #> Selected dataset thetao_baseline_2000_2019_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/thetao_baseline_2000_2019_depthsurf.html #> Selected 1 variables: thetao_min #> Selected dataset thetao_baseline_2000_2019_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/thetao_baseline_2000_2019_depthsurf.html #> Selected 1 variables: thetao_mean #> Selected dataset thetao_baseline_2000_2019_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/thetao_baseline_2000_2019_depthsurf.html #> Selected 1 variables: thetao_max #> Selected dataset ph_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/ph_baseline_2000_2018_depthsurf.html #> Selected 1 variables: ph_mean #> Selected dataset po4_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/po4_baseline_2000_2018_depthsurf.html #> Selected 1 variables: po4_mean #> Selected dataset so_baseline_2000_2019_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/so_baseline_2000_2019_depthsurf.html #> Selected 1 variables: so_mean #> Selected dataset si_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/si_baseline_2000_2018_depthsurf.html #> Selected 1 variables: si_mean #> Selected dataset phyc_baseline_2000_2020_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/phyc_baseline_2000_2020_depthsurf.html #> Selected 1 variables: phyc_mean terra::plot(bermuda_enviro_regions) # Can also create environmental regions from the raw Bio-Oracle data using setting raw = TRUE and enviro_regions = TRUE. In this case, the `spatial_grid` should be a polygon of the area you want the data for bermuda_enviro_regions2 <- get_enviro_regions(spatial_grid = bermuda_eez, raw = TRUE, enviro_regions = TRUE, num_clusters = 3) #> Selected dataset chl_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/chl_baseline_2000_2018_depthsurf.html #> Selected 1 variables: chl_mean #> Selected dataset o2_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/o2_baseline_2000_2018_depthsurf.html #> Selected 1 variables: o2_mean #> Selected dataset no3_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/no3_baseline_2000_2018_depthsurf.html #> Selected 1 variables: no3_mean #> Selected dataset thetao_baseline_2000_2019_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/thetao_baseline_2000_2019_depthsurf.html #> Selected 1 variables: thetao_min #> Selected dataset thetao_baseline_2000_2019_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/thetao_baseline_2000_2019_depthsurf.html #> Selected 1 variables: thetao_mean #> Selected dataset thetao_baseline_2000_2019_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/thetao_baseline_2000_2019_depthsurf.html #> Selected 1 variables: thetao_max #> Selected dataset ph_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/ph_baseline_2000_2018_depthsurf.html #> Selected 1 variables: ph_mean #> Selected dataset po4_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/po4_baseline_2000_2018_depthsurf.html #> Selected 1 variables: po4_mean #> Selected dataset so_baseline_2000_2019_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/so_baseline_2000_2019_depthsurf.html #> Selected 1 variables: so_mean #> Selected dataset si_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/si_baseline_2000_2018_depthsurf.html #> Selected 1 variables: si_mean #> Selected dataset phyc_baseline_2000_2020_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/phyc_baseline_2000_2020_depthsurf.html #> Selected 1 variables: phyc_mean terra::plot(bermuda_enviro_regions2)"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_features.html","id":null,"dir":"Reference","previous_headings":"","what":"Get a set of feature data for a spatial grid — get_features","title":"Get a set of feature data for a spatial grid — get_features","text":"wrapper get_bathymetry(), get_seamounts_buffered(), get_knolls(), get_geomorphology(), get_coral_habitat(), get_enviro_regions(). See individual functions details.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_features.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get a set of feature data for a spatial grid — get_features","text":"","code":"get_features( spatial_grid = NULL, raw = FALSE, features = c(\"bathymetry\", \"seamounts\", \"knolls\", \"geomorphology\", \"corals\", \"enviro_regions\"), bathy_resolution = 1, seamount_buffer = 30000, antipatharia_threshold = 22, octocoral_threshold = 2, enviro_clusters = NULL, max_enviro_clusters = 6, antimeridian = NULL )"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_features.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get a set of feature data for a spatial grid — get_features","text":"spatial_grid sf terra::rast() grid, e.g. created using get_grid(). Alternatively, raw data required, sf polygon can provided, e.g. created using get_boundary(), set raw = TRUE. raw logical TRUE, spatial_grid sf polygon, raw feature data polygon(s) returned. Note list object, since raster sf data may returned. features vector feature names, can include: \"bathymetry\", \"seamounts\", \"knolls\", \"geomorphology\", \"corals\", \"enviro_regions\" bathy_resolution numeric; resolution (minutes) data pull ETOPO 2022 Global Relief model. Values less 1 can 0.5 (30 arc seconds) 0.25 (15 arc seconds) seamount_buffer numeric; distance seamount peak include output. Distance units area_polygon spatial_grid provided, use e.g. sf::st_crs(spatial_grid, parameters = TRUE)$units_gdal check units planning grid area polygon (works raster well sf objects) antipatharia_threshold numeric 0 100; threshold value habitat suitability antipatharia corals considered present (default 22, defined Yesson et al., 2017) octocoral_threshold numeric 0 7; threshold value many species (7) predicted present area octocorals considered present (default 2) enviro_clusters numeric; number environmental regions cluster data - used clustering algorithm necessary (default NULL) max_enviro_clusters numeric; maximum number environmental regions try using clustering algorithm (default 8) antimeridian spatial_grid span antimeridian? , set TRUE, otherwise set FALSE. set NULL (default) function try check spatial_grid spans antimeridian set appropriately.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_features.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get a set of feature data for a spatial grid — get_features","text":"raw = TRUE, list feature data returned (mixed raster sf objects). spatial_grid supplied, multi-layer raster sf object gridded data returned, depending spatial_grid format.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_features.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get a set of feature data for a spatial grid — get_features","text":"","code":"# Grab EEZ data first bermuda_eez <- get_boundary(name = \"Bermuda\") #> Cache is fresh. Reading: /tmp/RtmpGtftbr/eez-2205f12f/eez.shp #> (Last Modified: 2025-01-09 06:02:16.566641) # Get raw data for Bermuda's EEZ raw_data <- get_features(spatial_grid = bermuda_eez, raw = TRUE) #> Getting depth zones... #> This may take seconds to minutes, depending on grid size #> Getting seamount data... #> Spherical geometry (s2) switched off #> although coordinates are longitude/latitude, st_intersection assumes that they #> are planar #> Warning: attribute variables are assumed to be spatially constant throughout all geometries #> Warning: st_buffer does not correctly buffer longitude/latitude data #> dist is assumed to be in decimal degrees (arc_degrees). #> Spherical geometry (s2) switched on #> Getting knoll data... #> Spherical geometry (s2) switched off #> although coordinates are longitude/latitude, st_intersection assumes that they #> are planar #> Warning: attribute variables are assumed to be spatially constant throughout all geometries #> Spherical geometry (s2) switched on #> Getting geomorphology data... #> Getting coral data... #> Getting environmental regions data... This could take several minutes # Get feature data in a spatial grid bermuda_grid <- get_grid(boundary = bermuda_eez, crs = '+proj=laea +lon_0=-64.8108333 +lat_0=32.3571917 +datum=WGS84 +units=m +no_defs', resolution = 20000) features_gridded <- get_features(spatial_grid = bermuda_grid) #> Getting depth zones... #> This may take seconds to minutes, depending on grid size #> Getting seamount data... #> Spherical geometry (s2) switched off #> although coordinates are longitude/latitude, st_intersection assumes that they #> are planar #> Warning: attribute variables are assumed to be spatially constant throughout all geometries #> Spherical geometry (s2) switched on #> Getting knoll data... #> Spherical geometry (s2) switched off #> although coordinates are longitude/latitude, st_intersection assumes that they #> are planar #> Warning: attribute variables are assumed to be spatially constant throughout all geometries #> Spherical geometry (s2) switched on #> Getting geomorphology data... #> Getting coral data... #> Getting environmental regions data... This could take several minutes terra::plot(features_gridded)"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_geomorphology.html","id":null,"dir":"Reference","previous_headings":"","what":"Get seafloor geomorphology data — get_geomorphology","title":"Get seafloor geomorphology data — get_geomorphology","text":"Get geomorphological data spatial grid polygon","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_geomorphology.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get seafloor geomorphology data — get_geomorphology","text":"","code":"get_geomorphology(spatial_grid = NULL, raw = FALSE, antimeridian = NULL)"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_geomorphology.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get seafloor geomorphology data — get_geomorphology","text":"spatial_grid sf terra::rast() grid, e.g. created using get_grid(). Alternatively, raw data required, sf polygon can provided, e.g. created using get_boundary(), set raw = TRUE. raw logical TRUE, spatial_grid sf polygon, raw data polygon(s) returned antimeridian spatial_grid span antimeridian? , set TRUE, otherwise set FALSE. set NULL (default) function try check spatial_grid spans antimeridian set appropriately.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_geomorphology.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get seafloor geomorphology data — get_geomorphology","text":"gridded data, multi-layer raster object, sf object geomorphology class column, depending spatial_grid format. raw = TRUE sf object row different geomorphological feature.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_geomorphology.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get seafloor geomorphology data — get_geomorphology","text":"Geomorphological features Harris et al. 2014 dataset, available https://www.bluehabitats.org. Data included package, except depth classification features can created using get_bathymetry() seamounts can retrieved recent dataset using get_seamounts(). List features: Abyssal hills Abyssal plains Basins: large basins seas oceans major ocean basins perched shelf perched slope small basins seas oceans Bridges Canyons: blind shelf incising Escarpments Fans Glacial troughs Guyots Plateaus Ridges Rift valleys Rises Shelf valleys: large shelf valleys glacial troughs moderate size small Sills Spreading ridges Terraces Trenches Troughs","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_geomorphology.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get seafloor geomorphology data — get_geomorphology","text":"","code":"# Grab EEZ data first bermuda_eez <- get_boundary(name = \"Bermuda\") #> Cache is fresh. Reading: /tmp/RtmpGtftbr/eez-2205f12f/eez.shp #> (Last Modified: 2025-01-09 06:02:16.566641) # Get geomorphology for the EEZ bermuda_geomorph <- get_geomorphology(spatial_grid = bermuda_eez, raw = TRUE) #> Spherical geometry (s2) switched off #> although coordinates are longitude/latitude, st_intersection assumes that they #> are planar #> Spherical geometry (s2) switched on plot(bermuda_geomorph) # Get geomorphological features in spatial_grid bermuda_grid <- get_grid(boundary = bermuda_eez, crs = '+proj=laea +lon_0=-64.8108333 +lat_0=32.3571917 +datum=WGS84 +units=m +no_defs', resolution = 20000) geomorph_gridded <- get_geomorphology(spatial_grid = bermuda_grid) #> Spherical geometry (s2) switched off #> although coordinates are longitude/latitude, st_intersection assumes that they #> are planar #> Spherical geometry (s2) switched on"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_gfw.html","id":null,"dir":"Reference","previous_headings":"","what":"Get data from Global Fishing Watch — get_gfw","title":"Get data from Global Fishing Watch — get_gfw","text":"Global Fishing Watch (GFW) provides data apparent fishing effort (hours) 0.01 degree spatial resolution, based automatic identification system (AIS) broadcasts vessels. Data principally larger vessel (> 24m length); less 1% vessels <12 m length represented data (see GFW website detailed information). function primarily wrapper gfwr package function get_raster(), allows user return multiple years data summarized gridded format. API key required retrieve GFW data; see package website instructions get save one (free).","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_gfw.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get data from Global Fishing Watch — get_gfw","text":"","code":"get_gfw( spatial_grid = NULL, raw = FALSE, resolution = \"LOW\", start_year = 2018, end_year = 2023, group_by = \"location\", summarise = \"mean_total_annual_effort\", key = gfwr::gfw_auth() )"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_gfw.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get data from Global Fishing Watch — get_gfw","text":"spatial_grid sf terra::rast() grid, e.g. created using get_grid(). Alternatively, raw data required, sf polygon can provided, e.g. created using get_boundary(), set raw = TRUE. raw logical TRUE, spatial_grid can sf polygon, raw GFW data, tibble format, returned bounding box covering polygon +/-1 degree. bounding box expanded ensure entire polygon data coverage point data rasterized. data summarised, .e. summarise ignored. resolution string either \"HIGH\" = 0.01 degree spatial resolution, \"LOW\" = 0.1. start_year numeric must 2012 recent year. Note GFW added data Spire Orbcomm AIS providers 2017, data 2017 likely greater spatial temporal coverage (Welch et al. 2022). end_year numeric year 2012 current year group_by string can \"geartype\", \"flag\", \"location\". summarise string can \"total_annual_effort\"; sum fishing effort years, start_year end_year location returned, grouped group_by; \"mean_total_annual_effort\"; mean annual sums fishing effort years location returned, grouped group_by. key string Authorization token. Can obtained gfw_auth() function. See gfwr website details request token.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_gfw.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get data from Global Fishing Watch — get_gfw","text":"gridded data, terra::rast() sf object, depending spatial_grid format. raw = TRUE, non-summarised data tibble format returned polygon area direct GFW query gfwr::get_raster().","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_gfw.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get data from Global Fishing Watch — get_gfw","text":"","code":"if (FALSE) { # nchar(Sys.getenv(\"GFW_TOKEN\")) > 0 #get mean total annual fishing effort for Bermuda for the years 2022-2023 #first get a grid for Bermuda bermuda_grid <- get_boundary(name = \"Bermuda\") %>% get_grid(resolution = 0.1, crs = 4326) bermuda_gfw_effort <- get_gfw(spatial_grid = bermuda_grid, start_year = 2022) #plot the data terra::plot(bermuda_gfw_effort) #get total fishing effort for each gear type in Fiji's EEZ for 2022 fiji_grid <- get_boundary(name = \"Fiji\") %>% get_grid(resolution = 1e4, crs = \"+proj=tcea +lon_0=178 +datum=WGS84 +units=m +no_defs\", output = \"sf_square\") fiji_gfw_effort <- get_gfw(spatial_grid = fiji_grid, start_year = 2022, end_year = 2022, group_by = \"geartype\", summarise = \"total_annual_effort\") plot(fiji_gfw_effort, border = FALSE) #quantile is better for viewing the fishing effort distribution due to the long tail of values plot(fiji_gfw_effort[1], border= FALSE, breaks = \"quantile\") }"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_knolls.html","id":null,"dir":"Reference","previous_headings":"","what":"Get knolls base areas — get_knolls","title":"Get knolls base areas — get_knolls","text":"Get knolls base area data spatial grid polygon","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_knolls.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get knolls base areas — get_knolls","text":"","code":"get_knolls( spatial_grid = NULL, raw = FALSE, name = \"knolls\", antimeridian = NULL )"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_knolls.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get knolls base areas — get_knolls","text":"spatial_grid sf terra::rast() grid, e.g. created using get_grid(). Alternatively, raw data required, sf polygon can provided, e.g. created using get_boundary(), set raw = TRUE. raw logical TRUE, spatial_grid sf polygon, raw data polygon(s) returned name string; name raster column sf object returned antimeridian spatial_grid span antimeridian? , set TRUE, otherwise set FALSE. set NULL (default) function try check spatial_grid spans antimeridian set appropriately.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_knolls.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get knolls base areas — get_knolls","text":"gridded data, terra::rast() sf object, depending spatial_grid format. raw = TRUE sf object crop intersected polygon supplied.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_knolls.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get knolls base areas — get_knolls","text":"Knolls small seamounts; seamounts peaks 200-1000 m higher surrounding seafloor (Morato et al., 2008). knolls base area data Yesson et al. 2011","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_knolls.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get knolls base areas — get_knolls","text":"","code":"# Get EEZ data first bermuda_eez <- get_boundary(name = \"Bermuda\") #> Cache is fresh. Reading: /tmp/RtmpGtftbr/eez-2205f12f/eez.shp #> (Last Modified: 2025-01-09 06:02:16.566641) # Get raw knolls data for Bermuda's EEZ knolls <- get_knolls(spatial_grid= bermuda_eez, raw = TRUE) #> Spherical geometry (s2) switched off #> although coordinates are longitude/latitude, st_intersection assumes that they #> are planar #> Warning: attribute variables are assumed to be spatially constant throughout all geometries #> Spherical geometry (s2) switched on # Get gridded knolls data: first create a grid bermuda_grid <- get_grid(boundary = bermuda_eez, crs = '+proj=laea +lon_0=-64.8108333 +lat_0=32.3571917 +datum=WGS84 +units=m +no_defs', resolution = 10000) knolls_gridded <- get_knolls(spatial_grid = bermuda_grid) #> Spherical geometry (s2) switched off #> although coordinates are longitude/latitude, st_intersection assumes that they #> are planar #> Warning: attribute variables are assumed to be spatially constant throughout all geometries #> Spherical geometry (s2) switched on"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_seamounts.html","id":null,"dir":"Reference","previous_headings":"","what":"Get seamounts — get_seamounts","title":"Get seamounts — get_seamounts","text":"Get seamounts data spatial grid polygon","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_seamounts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get seamounts — get_seamounts","text":"","code":"get_seamounts( spatial_grid = NULL, raw = FALSE, buffer = NULL, name = \"seamounts\", antimeridian = NULL )"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_seamounts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get seamounts — get_seamounts","text":"spatial_grid sf terra::rast() grid, e.g. created using get_grid(). Alternatively, raw data required, sf polygon can provided, e.g. created using get_boundary(), set raw = TRUE. raw logical TRUE, spatial_grid sf polygon, raw data polygon(s) returned buffer numeric; distance seamount peak include output. Distance units spatial_grid, use e.g. sf::st_crs(spatial_grid, parameters = TRUE)$units_gdal check units. buffering raw data, units metres, unless sf::sf_use_s2() set FALSE, case units degrees. name string; name raster column sf object returned antimeridian spatial_grid span antimeridian? , set TRUE, otherwise set FALSE. set NULL (default) function try check spatial_grid spans antimeridian set appropriately.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_seamounts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get seamounts — get_seamounts","text":"buffered seamounts gridded data, terra::rast() sf object, depending spatial_grid format. raw = TRUE buffer = NULL sf POINT geometry object seamount peaks within polygon provided. raw = TRUE buffer NULL sf polygon geometry object buffered seamount peaks within polygon provided. Note: present, possible return gridded seamount peaks: https://github.com/emlab-ucsb/oceandatr/issues/48","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_seamounts.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get seamounts — get_seamounts","text":"Seamounts classified peaks least 1000m higher surrounding seafloor Morato et al. 2008. seamounts peak dataset Yeson et al. 2021. Morato et al. 2010 found seamounts higher biodiversity within 30 - 40 km peak. enable radius higher biodiversity included conservation planning, buffer argument can set, seamount peak buffered radius specified","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_seamounts.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get seamounts — get_seamounts","text":"","code":"# Get EEZ data first bermuda_eez <- get_boundary(name = \"Bermuda\") #> Cache is fresh. Reading: /tmp/RtmpGtftbr/eez-2205f12f/eez.shp #> (Last Modified: 2025-01-09 06:02:16.566641) # Get raw seamounts data seamount_peaks <- get_seamounts(spatial_grid = bermuda_eez, raw = TRUE) #> Spherical geometry (s2) switched off #> although coordinates are longitude/latitude, st_intersection assumes that they #> are planar #> Warning: attribute variables are assumed to be spatially constant throughout all geometries #> Spherical geometry (s2) switched on plot(seamount_peaks[\"Depth\"]) # Get gridded seamount data bermuda_grid <- get_grid(boundary = bermuda_eez, crs = '+proj=laea +lon_0=-64.8108333 +lat_0=32.3571917 +datum=WGS84 +units=m +no_defs', resolution = 10000) #buffer seamounts to a distance of 30 km (30,000 m) seamounts_gridded <- get_seamounts(spatial_grid = bermuda_grid, buffer = 30000) #> Spherical geometry (s2) switched off #> although coordinates are longitude/latitude, st_intersection assumes that they #> are planar #> Warning: attribute variables are assumed to be spatially constant throughout all geometries #> Spherical geometry (s2) switched on terra::plot(seamounts_gridded)"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/oceandatr-package.html","id":null,"dir":"Reference","previous_headings":"","what":"oceandatr: Ocean Data Access — oceandatr-package","title":"oceandatr: Ocean Data Access — oceandatr-package","text":"retrieving gridding ocean related data.","code":""},{"path":[]},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/oceandatr-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"oceandatr: Ocean Data Access — oceandatr-package","text":"Maintainer: Jason Flower jflower@ucsb.edu (ORCID)","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/pipe.html","id":null,"dir":"Reference","previous_headings":"","what":"Pipe operator — %>%","title":"Pipe operator — %>%","text":"See magrittr::%>% details.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/pipe.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pipe operator — %>%","text":"","code":"lhs %>% rhs"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/pipe.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Pipe operator — %>%","text":"lhs value magrittr placeholder. rhs function call using magrittr semantics.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/pipe.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Pipe operator — %>%","text":"result calling rhs(lhs).","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/reexports.html","id":null,"dir":"Reference","previous_headings":"","what":"Objects exported from other packages — reexports","title":"Objects exported from other packages — reexports","text":"objects imported packages. Follow links see documentation. spatialgridr get_boundary, get_data_in_grid, get_grid","code":""}]
+[{"path":"https://emlab-ucsb.github.io/oceandatr/articles/getboundary.html","id":"marine-boundaries","dir":"Articles","previous_headings":"","what":"Marine boundaries","title":"Retrieving boundaries with get_boundary()","text":"get_boundary() uses mregions2::mrp_get() function mregions2 package - R package Marine Regions database. database quite extensive several options querying areas. get_boundary() intended provide functionality mregions2, just slightly simpler interface getting commonly used boundaries exclusive economic zones (EEZs), global ocean boundaries, high seas areas. using get_boundary() type = \"eez\", type = \"12nm\" type = \"24nm\", country_type can either country_type = \"country\" country_type = \"sovereign\". Using \"country\" returns EEZ, 12nm 24nm boundary mainland country, using \"sovereign\" returns boundaries states territories country sovereignty well. examples show works. Note type = \"ocean\" type = \"high_seas\", country_type ignored. simple query get Australia’s EEZ: lets look happens change country_type default \"country\" \"sovereign\": now get just main country Australia, islands sovereignty . detail, see Marine Regions attribute table; using country_type = \"country\" queries using ‘territory1’ attribute, using country_type = \"sovereign\" uses ‘territory1’ attribute. another example using France. EEZ bordering mainland France retrieved country_type = \"country\", setting country_type = \"sovereign\" also get islands France sovereignty . EEZ mainland France (blue) overseas territories (solid outlines). World coastlines shown dashed line reference. example, might want use sovereign trying get islands make Kiribati. Using country_type = \"country\" return anything island group listed country. Note name provided found, list possible country_type options chose provided (part output shown brevity): Try , setting country_type = \"sovereign\": Kiribati’s EEZ. World coastlines shown dashed line reference. mregions2 package can used query many different marine boundaries, included options get_boundary():","code":"aus_eez <- get_boundary(name = \"Australia\", type = \"eez\") plot(aus_eez[\"geometry\"], axes = TRUE) aus_eez_sov <- get_boundary(name = \"Australia\", type = \"eez\", country_type = \"sovereign\") plot(aus_eez_sov[\"geometry\"], axes = TRUE) fr_eez <- get_boundary(name = \"France\", type = \"eez\", country_type = \"country\") fr_eez_sov <- get_boundary(name = \"France\", type = \"eez\", country_type = \"sovereign\") plot(sf::st_geometry(fr_eez_sov), lwd = 1, axes = TRUE) plot(fr_eez[\"geometry\"], col = \"royalblue\", add = T) plot(rnaturalearth::ne_coastline(scale = 110)[\"geometry\"], lty = 3, add = TRUE) get_boundary(name = \"Kiribati\", type = \"eez\", country_type = \"country\") kir_eez <- get_boundary(name = \"Kiribati\", type = \"eez\", country_type = \"sovereign\") plot(sf::st_geometry(kir_eez), col = \"royalblue\") plot(rnaturalearth::ne_coastline(scale = 110)[\"geometry\"], lty = 3, add = TRUE) mregions2::mrp_list[,c(\"title\", \"layer\")]"},{"path":"https://emlab-ucsb.github.io/oceandatr/articles/getboundary.html","id":"land-boundaries","dir":"Articles","previous_headings":"","what":"Land boundaries","title":"Retrieving boundaries with get_boundary()","text":"get_boundary() uses rnaturalearth::ne_countries() function [rnaturalearth``](https://docs.ropensci.org/rnaturalearth/index.html) package retrieve land boundaries.get_boundary()` intended provide slightly simpler interface getting commonly used land boundaries. maritime boundaries, country_type can specified either country_type = \"country\" country_type = \"sovereign\" depending whether main country required country territories/ states sovereignty . following examples show options work practice. rnaturalearth package vignette contains details constitutes country options querying. query France setting country_type = \"country\" get: slightly unexpected perhaps, islands Guadeloupe Martinique Caribbean, Mayotte Réunion Western Indian Ocean, French Guiana South America, status mainland France. use country_type = \"sovereign\", also get France’s overseas territories Pacific, Atlantic Antarctic:","code":"france <- get_boundary(name = \"France\", type = \"country\", country_type = \"country\") plot(sf::st_geometry(france), col = \"blue\") plot(rnaturalearth::ne_coastline(scale = 110)[\"geometry\"], lty = 3, add = TRUE) france_sov <- get_boundary(name = \"France\", type = \"country\", country_type = \"sovereign\") plot(sf::st_geometry(france_sov), col = \"blue\") plot(rnaturalearth::ne_coastline(scale = 110)[\"geometry\"], lty = 3, add = TRUE)"},{"path":"https://emlab-ucsb.github.io/oceandatr/articles/pacific_high_seas_example.html","id":"high-seas-area-of-the-pacific-ocean","dir":"Articles","previous_headings":"","what":"High Seas area of the Pacific Ocean","title":"Pacific High Seas Example","text":"First retrieve geospatial data North Pacific Ocean using get_boundary(), crop area interested , highlighted red map. Map High Seas going use highlighted Pacific area borders Indonesia, Papua New Guinea, Palau Federated States Micronesia. can get EEZs states using oceandatr’s get_area function. want high sea portion area outlined . can now create polygon remove bordering states EEZs. Map Pacific High Seas area regional context Now select suitable projection area suitable resolution planning grid used gridding data. can use projection wizard find equal-area projection, entering extent coordinates used crop high seas area (xmin = 135, xmax = 155, ymin = 0, ymax = 6). use 10km square planning units data processing prioritization run reasonably fast (smaller planning units require time/ computer memory get data ) Pacific High Seas area planning grid raster Now planning grid, can get data conservation features (e.g. habitats) using oceandatr use spatial prioritization single command get_features(). set seamount buffer, area around seamount included part seamount, use 30km based since biodiversity known higher within distance seamount peaks (see ?get_seamounts_buffered info). Conservation features Pacific High Seas planning area","code":"high_seas <- get_boundary(type = \"high_seas\") pacific_hs_area_extent <- sf::st_bbox(c(xmin = 135, xmax = 155, ymin = 0, ymax = 6), crs = 4326) plot(sf::st_geometry(high_seas), main = \"High Seas\", col = \"royalblue3\", axes = TRUE, las = 1) plot(pacific_hs_area_extent %>% sf::st_as_sfc() %>% sf::st_cast(to = \"LINESTRING\"), col = \"red\", lwd=2, add = TRUE) country_names <- c(\"Indonesia\", \"Papua New Guinea\", \"Palau\", \"Micronesia\") eezs <- lapply(country_names, FUN = function(x) get_boundary(name = x) %>% dplyr::select(territory1) %>% dplyr::rename(name = territory1)) %>% do.call(rbind, .) %>% sf::st_cast(to = \"MULTIPOLYGON\") sf::sf_use_s2(FALSE) #turn off S2 to avoid errors pacific_hs <- high_seas %>% sf::st_crop(pacific_hs_area_extent) %>% sf::st_sf() %>% dplyr::mutate(name = \"Pacific High Seas area\") %>% dplyr::select(name) sf::sf_use_s2(TRUE) plot(rbind(sf::st_cast(pacific_hs, to = \"MULTIPOLYGON\"), eezs), axes = TRUE, main = NULL, key.pos = 4) pacific_hs_projection <- \"+proj=cea +lon_0=145 +lat_ts=3 +datum=WGS84 +units=m +no_defs\" pacific_hs_planning_grid <- get_grid(boundary = pacific_hs, crs = pacific_hs_projection, resolution = 10000) #get_grid returns a raster by default, so we can plot it using the terra package terra::plot(pacific_hs_planning_grid, col = \"grey70\") feature_set <- get_features(spatial_grid = pacific_hs_planning_grid, seamount_buffer = 30000) %>% oceandatr:::remove_empty_layers() #use this to remove raster layers that are empty terra::plot(feature_set, col = c(\"grey60\", \"royalblue\"), maxnl = terra::nlyr(feature_set), axes = FALSE, fun = function(x)terra::lines(pacific_hs %>% sf::st_transform(pacific_hs_projection))) #set maximum number of layers to plot to the same as the number of layers in the feature set"},{"path":"https://emlab-ucsb.github.io/oceandatr/articles/pacific_high_seas_example.html","id":"cost-data-global-fishing-watch-data","dir":"Articles","previous_headings":"","what":"Cost data: Global Fishing Watch data","title":"Pacific High Seas Example","text":"piece data needed spatial prioritization cost. terrestrial spatial planning, can actually monetary value buying land conservation. marine spatial planning, measures fishing, catch fishing effort, often used opportunity cost planning unit. Global Fishing Watch global fishing effort data, can accessed easily using get_gfw() function oceandatr (wrapper get_raster() function gfwr package). API key required, can easily generated cost; see gfwr website details. Map total apparent fishing effort 2022 Pacific High Seas area. Data Global Fishing Watch","code":"fishing_effort <- get_gfw(spatial_grid = pacific_hs_planning_grid, start_year = 2022, end_year = 2022, summarise = \"total_annual_effort\") %>% terra::subst(NA, 0.01) %>% #set NA values to zero otherwise they will be left out of the prioritization terra::mask(pacific_hs_planning_grid) %>% setNames(\"fishing_effort\") terra::plot(fishing_effort, fun = terra::lines(pacific_hs %>% sf::st_transform(pacific_hs_projection)), axes = FALSE)"},{"path":"https://emlab-ucsb.github.io/oceandatr/articles/pacific_high_seas_example.html","id":"run-a-simple-spatial-prioritization","dir":"Articles","previous_headings":"","what":"Run a simple spatial prioritization","title":"Pacific High Seas Example","text":"now data need create conservation problem solve get map priority areas conservation Pacific High Seas area. prioritization, need set targets much conservation feature must included prioritized areas. set 20%. Prioritization solution Pacific High Seas area. Black outlines seamounts.","code":"prob <- prioritizr::problem(x = fishing_effort, features = feature_set) %>% add_min_set_objective() %>% add_relative_targets(0.2) %>% #add_boundary_penalties(penalty = 0.00001) %>% add_binary_decisions() %>% add_lpsymphony_solver(verbose = FALSE) sol <- solve(prob) terra::plot(sol, main = \"Solution\", col = c(\"grey70\", \"green4\"), type = \"classes\", levels = c(\"Not selected\", \"Selected\"), fun = terra::lines(pacific_hs %>% sf::st_transform(pacific_hs_projection)), axes = FALSE, mar = c(3,3,2,6)+0.1) terra::plot(terra::as.polygons(feature_set[[\"seamounts\"]]), add=TRUE)"},{"path":"https://emlab-ucsb.github.io/oceandatr/articles/pacific_high_seas_example.html","id":"prioritization-with-patches","dir":"Articles","previous_headings":"","what":"Prioritization with patches","title":"Pacific High Seas Example","text":"ensure whole seamount areas area included solution, need use patchwise package pre-processing data use. prioritization result similar , whole seamount patches equal least 20% total seamount area included. Prioritization solution Pacific High Seas area, whole seamounts included. Black outlines seamounts.","code":"# Separate seamount data - we want to protect entire patches seamounts_rast <- feature_set[[\"seamounts\"]] features_rast <- feature_set[[names(feature_set)[names(feature_set) != \"seamounts\"]]] # Create seamount patches - seamount areas that touch are considered the same patch patches_rast <- patchwise::create_patches(seamounts_rast %>% terra::subst(0, NA)) #patchwise currently expects all non-patches to be NA, some subsituting non-seamounts, which are currently zeroes, with NAs # Create patches dataframe - this creates several constraints so that entire seamount units are protected together patches_df_rast <- patchwise::create_patch_df(spatial_grid = pacific_hs_planning_grid, features = features_rast, patches = patches_rast, costs = fishing_effort) #> [1] \"Processing patch 1 of 6\" #> [1] \"Processing patch 2 of 6\" #> [1] \"Processing patch 3 of 6\" #> [1] \"Processing patch 4 of 6\" #> [1] \"Processing patch 5 of 6\" #> [1] \"Processing patch 6 of 6\" # Create boundary matrix for prioritizr boundary_matrix_rast <- patchwise::create_boundary_matrix(spatial_grid = pacific_hs_planning_grid, patches = patches_rast, patch_df = patches_df_rast) # Create targets for protection - let's just do 20% for each feature (including 20% of whole seamounts) targets_rast <- patchwise::features_targets(targets = rep(0.2, (terra::nlyr(features_rast) + 1)), features = features_rast, pre_patches = seamounts_rast) # Add these targets to targets for protection for the \"constraints\" we introduced to protect entire seamount units constraints_rast <- patchwise::constraints_targets(feature_targets = targets_rast, patch_df = patches_df_rast) # Run the prioritization problem_rast <- prioritizr::problem(x = patches_df_rast, features = constraints_rast$feature, cost_column = \"fishing_effort\") %>% prioritizr::add_min_set_objective() %>% prioritizr::add_manual_targets(constraints_rast) %>% prioritizr::add_binary_decisions() %>% #prioritizr::add_boundary_penalties(penalty = 0.0001, data = boundary_matrix_rast) %>% prioritizr::add_lpsymphony_solver() # Solve the prioritization solution_rast <- solve(problem_rast) # Convert the prioritization into a more digestible format result_rast <- patchwise::convert_solution(solution = solution_rast, patch_df = patches_df_rast, spatial_grid = pacific_hs_planning_grid) # Show the results terra::plot(result_rast, main = \"Solution\", col = c(\"grey70\", \"green4\"), type = \"classes\", levels = c(\"Not selected\", \"Selected\"), fun = terra::lines(pacific_hs %>% sf::st_transform(pacific_hs_projection)), axes = FALSE, mar = c(3,3,2,6)+0.1) terra::plot(terra::as.polygons(seamounts_rast), add=TRUE)"},{"path":"https://emlab-ucsb.github.io/oceandatr/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Jason Flower. Author, maintainer.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Flower J (2025). oceandatr: Ocean Data Access. R package version 0.2.1, https://emlab-ucsb.github.io/oceandatr/.","code":"@Manual{, title = {oceandatr: Ocean Data Access}, author = {Jason Flower}, year = {2025}, note = {R package version 0.2.1}, url = {https://emlab-ucsb.github.io/oceandatr/}, }"},{"path":"https://emlab-ucsb.github.io/oceandatr/index.html","id":"oceandatr-","dir":"","previous_headings":"","what":"Ocean Data Access","title":"Ocean Data Access","text":"oceandatr aims provide simple functions retrieving ocean data. Using associated package spatialgridr, can also easily grid data, useful various purposes including spatial conservation prioritization. Fish images logo modified original Tracey Saxby, Integration Application Network","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Ocean Data Access","text":"can install oceandatr GitHub :","code":"if (!require(remotes)) install.packages(\"remotes\") #might need to increase timeout as it is a large package options(timeout = 9999) remotes::install_github(\"emlab-ucsb/oceandatr\")"},{"path":"https://emlab-ucsb.github.io/oceandatr/index.html","id":"getting-gridded-ocean-data","dir":"","previous_headings":"","what":"Getting gridded ocean data","title":"Ocean Data Access","text":"","code":"#load oceandatr package library(oceandatr)"},{"path":"https://emlab-ucsb.github.io/oceandatr/index.html","id":"obtain-an-eez-for-an-area-of-interest","dir":"","previous_headings":"","what":"Obtain an EEZ for an area of interest","title":"Ocean Data Access","text":"First need boundary area interested . can use get_boundary() function, imported spatialgridr, get boundary land ocean. example get Bermuda’s Exclusive Economic Zone (EEZ)","code":"bermuda_eez <- get_boundary(name = \"Bermuda\") #plot to check we have Bermuda's EEZ plot(bermuda_eez[1], col = \"lightblue\", main=NULL, axes=TRUE)"},{"path":"https://emlab-ucsb.github.io/oceandatr/index.html","id":"get-a-grid","dir":"","previous_headings":"","what":"Get a grid","title":"Ocean Data Access","text":"going get gridded data. create grid Bermuda, use get_grid(). need provide suitable projection area interested , https://projectionwizard.org useful purpose. Standard projections used countries can also found https://epsg.io/ searching country name. spatial planning, equal area projections normally best. bounding box coordinates area interest can found using sf::st_bbox(bermuda_eez) can used generate coordinate reference system (CRS) projection wizard coordinates entered ‘Geographic extent’ map box drawn around bounding box area interest. projection can copied pasted pop-box clicking ‘WKT’ ‘PROJ’. brevity, using PROJ string, WKT now generally preferred. projection needs placed quotation marks follows: can now create grid Bermuda’s EEZ using get_grid(). Along projection found , need set resolution: wide high grid cell , case metres. units depend crs can found using e.g. sf::st_crs(projection_bermuda, parameters = TRUE)$units_gdal raster covers Bermuda’s EEZ. grid cells small see plotted , coarser grid (lower resolution) visualized can see grid cells look like.","code":"projection_bermuda <- '+proj=laea +lon_0=-64.8108333 +lat_0=32.3571917 +datum=WGS84 +units=m +no_defs' bermuda_grid <- get_grid(boundary = bermuda_eez, resolution = 5000, crs = projection_bermuda) #project the eez into same projection as grid for plotting bermuda_eez_projected <- bermuda_eez %>% sf::st_transform(crs = projection_bermuda) %>% sf::st_geometry() #plot the grid terra::plot(bermuda_grid, col = \"gold3\", axes = FALSE, legend = FALSE) plot(bermuda_eez_projected, add=TRUE) bermuda_grid_coarse <- get_grid(boundary = bermuda_eez, resolution = 20000, crs = projection_bermuda) plot(bermuda_eez_projected, axes = FALSE) terra::plot(terra::as.polygons(bermuda_grid_coarse, dissolve = FALSE), add=TRUE)"},{"path":"https://emlab-ucsb.github.io/oceandatr/index.html","id":"get-bathymetry","dir":"","previous_headings":"","what":"Get bathymetry","title":"Ocean Data Access","text":"Now grid, can get data. key piece data bathymetry. user bathymetry data area interest already, can pass file path function grid data using supplied spatial grid. file path provided, function extract bathymetry data area ETOPO 2022 Global Relief model using function borrowed marmap package.","code":"bathymetry <- get_bathymetry(spatial_grid = bermuda_grid, classify_bathymetry = FALSE) #> This may take seconds to minutes, depending on grid size terra::plot(bathymetry, col = hcl.colors(n=255, \"Blues\"), axes = FALSE) plot(bermuda_eez_projected, add=TRUE)"},{"path":"https://emlab-ucsb.github.io/oceandatr/index.html","id":"depth-classification","dir":"","previous_headings":"Get bathymetry","what":"Depth classification","title":"Ocean Data Access","text":"ocean can classified 5 depth zones: 0 - 200m: Epipelagic zone 200 - 1000m: Mesopelagic zone 1000 - 4000m: Bathypelagic zone 4000 - 6000m: Abyssopelagic zone 6000m+: Hadopelagic zone can get depth zones Bermuda simply setting classify_bathymetry argument get_bathymetry TRUE.","code":"depth_zones <- get_bathymetry(spatial_grid = bermuda_grid, classify_bathymetry = TRUE) #> This may take seconds to minutes, depending on grid size #value of 1 indicates that depth zone is present terra::plot(depth_zones, col = c(\"grey60\", \"navyblue\"), axes = FALSE, fun = function(){terra::lines(terra::vect(bermuda_eez_projected))})"},{"path":"https://emlab-ucsb.github.io/oceandatr/index.html","id":"get-geomorphological-data","dir":"","previous_headings":"","what":"Get geomorphological data","title":"Ocean Data Access","text":"seafloor valleys, plains geomorphological features just land. data come Harris et al. 2014, Geomorphology Oceans available download https://www.bluehabitats.org, depth classifications (can created using get_bathymetry()) seamounts (can retrieved recent dataset using get_seamounts()) included package.","code":"geomorphology <- get_geomorphology(spatial_grid = bermuda_grid) %>% remove_empty_layers() #can remove any empty layers so we don't have so many layers to plot #brown colour indicates that geomorphological feature is present terra::plot(geomorphology, col = data.frame(c(0,1), c(\"grey60\", \"sienna\")), axes = FALSE, legend = FALSE, fun = function(){terra::lines(terra::vect(bermuda_eez_projected))})"},{"path":"https://emlab-ucsb.github.io/oceandatr/index.html","id":"get-knolls-data","dir":"","previous_headings":"","what":"Get knolls data","title":"Ocean Data Access","text":"Knolls another geomorphological feature, ‘small’ seamounts, classified seamounts 200 1000m higher surrounding seafloor Morato et al. 2008. Data knoll base area data Yesson et al. 2011.","code":"knolls <- get_knolls(spatial_grid = bermuda_grid) #value of 1 indicates that knolls are present terra::plot(knolls, col = c(\"grey60\", \"grey20\"), axes = FALSE) plot(bermuda_eez_projected, add=TRUE)"},{"path":"https://emlab-ucsb.github.io/oceandatr/index.html","id":"get-seamount-areas","dir":"","previous_headings":"","what":"Get seamount areas","title":"Ocean Data Access","text":"Seamounts, classified peaks least 1000m higher surrounding seafloor Morato et al. 2008. data Yesson et al. 2021. peak buffered distance specified function call. units buffer units spatial grid, can checked using, e.g. sf::st_crs(bermuda_grid, parameters = TRUE)$units_gdal","code":"#spatial grid units are metres, so set buffer to 30000 m = 30 km seamounts <- get_seamounts(spatial_grid = bermuda_grid, buffer = 30000) #value of 1 indicates that seamount is present terra::plot(seamounts, col = c( \"grey60\", \"saddlebrown\"), axes = FALSE) plot(bermuda_eez_projected, add=TRUE)"},{"path":"https://emlab-ucsb.github.io/oceandatr/index.html","id":"habitat-suitability-models","dir":"","previous_headings":"","what":"Habitat suitability models","title":"Ocean Data Access","text":"Retrieve habitat suitability data 3 deep water coral groups: Antipatharia: Habitats associated increased biodiversity invertebrate vertebrate species; global distributions modeled Yesson et al. (2017) Cold water coral: Important habitats nursery areas many species; global distributions modeled Davies Guinotte (2011) Octocoral: Important habitats invertebrates, groundfish, rockfish species; global distributions modeled Yesson et al. (2012)","code":"coral_habitat <- get_coral_habitat(spatial_grid = bermuda_grid) #show the seamounts areas on the plot: coral habitat is often on seamounts which are shallower than surrounding ocean floor #value of 1 indicates that coral is present terra::plot(coral_habitat, col = c(\"grey60\", \"coral\"), axes = FALSE, fun = function()terra::lines(terra::as.polygons(seamounts, dissolve = TRUE), col = \"orangered4\"))"},{"path":"https://emlab-ucsb.github.io/oceandatr/index.html","id":"environmental-regions","dir":"","previous_headings":"","what":"Environmental Regions","title":"Ocean Data Access","text":"Bioregions often included spatial planning, available bioregional classifications either coarse detailed useful planning EEZ level. Borrowing methods Magris et al. 2020, use spatial clustering biophysical environmental data Bio-Oracle, create ‘environmental regions’. Biophysical conditions within environmental region similar areas outside region, though differences may small. Diagnostic boxplots PCA shown show_plots = TRUE. biophysical data ocean surface data period 2010 - 2020: Chlorophyll concentration (mean, mg/ m3) Dissolved oxygen concentration (mean) Nitrate concentration (mean, mmol/ m3) pH (mean) Phosphate concentration (mean, mmol/ m3) total Phytoplankton (primary productivity; mean, mmol/ m3) Salinity (mean) Sea surface temperature (max, degree C) Sea surface temperature (mean, degree C) Sea surface temperature (min, degree C) Silicate concentration (mean, mmol/ m3)","code":"#set number of clusters to 3 to reduce runtime and memory usage enviro_regions <- get_enviro_regions(spatial_grid = bermuda_grid, show_plots = TRUE, num_clusters = 3) #value of 1 indicates that environmental region is present terra::plot(enviro_regions, col = c(\"grey60\", \"forestgreen\"), axes = FALSE, fun = function(){terra::lines(terra::vect(bermuda_eez_projected))})"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_bathymetry.html","id":null,"dir":"Reference","previous_headings":"","what":"Get bathymetry data — get_bathymetry","title":"Get bathymetry data — get_bathymetry","text":"Get bathymetry data area ETOPO 2022 Global Relief model. data already downloaded locally, user can specify file path dataset. Data can classified depth zones setting classify_bathymetry = TRUE","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_bathymetry.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get bathymetry data — get_bathymetry","text":"","code":"get_bathymetry( spatial_grid = NULL, raw = FALSE, classify_bathymetry = TRUE, above_sea_level_isNA = FALSE, name = \"bathymetry\", bathymetry_data_filepath = NULL, resolution = 1, keep = FALSE, path = NULL, download_timeout = 300, antimeridian = NULL )"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_bathymetry.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get bathymetry data — get_bathymetry","text":"spatial_grid sf terra::rast() grid, e.g. created using get_grid(). Alternatively, raw data required, sf polygon can provided, e.g. created using get_boundary(), set raw = TRUE. raw logical TRUE, spatial_grid sf polygon, raw data polygon(s) returned classify_bathymetry logical; whether classify bathymetry depth zones. Original bathymetry data can classified raw = TRUE spatial_grid sf polygon. above_sea_level_isNA logical; whether set bathymetry (elevation) data values sea level (.e. greater equal zero) NA (TRUE) zero (FALSE) name string; name raster column sf object returned bathymetry_data_filepath string; file path (including file name extension) bathymetry raster data saved locally resolution numeric; resolution (minutes) data pull ETOPO 2022 Global Relief model. Values less 1 can 0.5 (30 arc seconds) 0.25 (15 arc seconds) keep logical; whether save bathymetry data locally path string; file path like save bathymetry data download_timeout numeric; maximum number seconds query NOAA website allowed run antimeridian spatial_grid span antimeridian? , set TRUE, otherwise set FALSE. set NULL (default) function try check spatial_grid spans antimeridian set appropriately.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_bathymetry.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get bathymetry data — get_bathymetry","text":"classify_bathymetry = FALSE, bathymetry data spatial_grid supplied, original raster file resolution raw = TRUE. classify_bathymetry = TRUE multi-layer raster sf object one zone column returned, depending spatial_grid format. classify_bathymetry = TRUE raw = TRUE (case spatial_grid sf polygon), raw raster bathymetry data classified depth zones.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_bathymetry.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get bathymetry data — get_bathymetry","text":"Extracts bathymetry data area_polygon, spatial_grid supplied, gridded bathymetry returned. Data can classified depth zones setting classify_bathymetry = TRUE. Depths classified follows: Epipelagic Zone: 0-200 m depth Mesopelagic Zone: 200-1000 m depth Bathypelagic Zone: 1000-4000 m depth Abyssopelagic Zone: 4000-6000 m depth Hadopelagic Zone: 6000+ m depth user downloaded bathymetry data area interest, example GEBCO (https://www.gebco.net), can pass file path function bathymetry_data_filepath. file path provided, function extract bathymetry data area ETOPO 2022 Global Relief model served NOAA (https://www.ncei.noaa.gov/products/etopo-global-relief-model).","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_bathymetry.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get bathymetry data — get_bathymetry","text":"","code":"# Get EEZ data first bermuda_eez <- get_boundary(name = \"Bermuda\") # Get raw bathymetry data, not classified into depth zones bathymetry <- get_bathymetry(spatial_grid = bermuda_eez, raw = TRUE, classify_bathymetry = FALSE) #> This may take seconds to minutes, depending on grid size terra::plot(bathymetry) # Get depth zones in spatial_grid bermuda_grid <- get_grid(boundary = bermuda_eez, crs = '+proj=laea +lon_0=-64.8108333 +lat_0=32.3571917 +datum=WGS84 +units=m +no_defs', resolution = 20000) depth_zones <- get_bathymetry(spatial_grid = bermuda_grid) #> This may take seconds to minutes, depending on grid size terra::plot(depth_zones) #It is also possible to get the raw bathymetry data in gridded format by setting raw = FALSE and classify_bathymetry = FALSE bermuda_grid_sf <- get_grid(boundary = bermuda_eez, crs = '+proj=laea +lon_0=-64.8108333 +lat_0=32.3571917 +datum=WGS84 +units=m +no_defs', resolution = 20000, output = \"sf_hex\") gridded_bathymetry <- get_bathymetry(spatial_grid = bermuda_grid_sf, classify_bathymetry = FALSE) #> This may take seconds to minutes, depending on grid size #> | | | 0% | | | 1% | |= | 1% | |= | 2% | |== | 2% | |== | 3% | |== | 4% | |=== | 4% | |=== | 5% | |==== | 5% | |==== | 6% | |===== | 6% | |===== | 7% | |===== | 8% | |====== | 8% | |====== | 9% | |======= | 9% | |======= | 10% | |======= | 11% | |======== | 11% | |======== | 12% | |========= | 12% | |========= | 13% | |========= | 14% | |========== | 14% | |========== | 15% | |=========== | 15% | |=========== | 16% | |============ | 16% | |============ | 17% | |============ | 18% | |============= | 18% | |============= | 19% | |============== | 19% | |============== | 20% | |============== | 21% | |=============== | 21% | |=============== | 22% | |================ | 22% | |================ | 23% | |================ | 24% | |================= | 24% | |================= | 25% | |================== | 25% | |================== | 26% | |=================== | 26% | |=================== | 27% | |=================== | 28% | |==================== | 28% | |==================== | 29% | |===================== | 29% | |===================== | 30% | |===================== | 31% | |====================== | 31% | |====================== | 32% | |======================= | 32% | |======================= | 33% | |======================= | 34% | |======================== | 34% | |======================== | 35% | |========================= | 35% | |========================= | 36% | |========================== | 36% | |========================== | 37% | |========================== | 38% | |=========================== | 38% | |=========================== | 39% | |============================ | 39% | |============================ | 40% | |============================ | 41% | |============================= | 41% | |============================= | 42% | |============================== | 42% | |============================== | 43% | |============================== | 44% | |=============================== | 44% | |=============================== | 45% | |================================ | 45% | |================================ | 46% | |================================= | 46% | |================================= | 47% | |================================= | 48% | |================================== | 48% | |================================== | 49% | |=================================== | 49% | |=================================== | 50% | |=================================== | 51% | |==================================== | 51% | |==================================== | 52% | |===================================== | 52% | |===================================== | 53% | |===================================== | 54% | |====================================== | 54% | |====================================== | 55% | |======================================= | 55% | |======================================= | 56% | |======================================== | 56% | |======================================== | 57% | |======================================== | 58% | |========================================= | 58% | |========================================= | 59% | |========================================== | 59% | |========================================== | 60% | |========================================== | 61% | |=========================================== | 61% | |=========================================== | 62% | |============================================ | 62% | |============================================ | 63% | |============================================ | 64% | |============================================= | 64% | |============================================= | 65% | |============================================== | 65% | |============================================== | 66% | |=============================================== | 66% | |=============================================== | 67% | |=============================================== | 68% | |================================================ | 68% | |================================================ | 69% | |================================================= | 69% | |================================================= | 70% | |================================================= | 71% | |================================================== | 71% | |================================================== | 72% | |=================================================== | 72% | |=================================================== | 73% | |=================================================== | 74% | |==================================================== | 74% | |==================================================== | 75% | |===================================================== | 75% | |===================================================== | 76% | |====================================================== | 76% | |====================================================== | 77% | |====================================================== | 78% | |======================================================= | 78% | |======================================================= | 79% | |======================================================== | 79% | |======================================================== | 80% | |======================================================== | 81% | |========================================================= | 81% | |========================================================= | 82% | |========================================================== | 82% | |========================================================== | 83% | |========================================================== | 84% | |=========================================================== | 84% | |=========================================================== | 85% | |============================================================ | 85% | |============================================================ | 86% | |============================================================= | 86% | |============================================================= | 87% | |============================================================= | 88% | |============================================================== | 88% | |============================================================== | 89% | |=============================================================== | 89% | |=============================================================== | 90% | |=============================================================== | 91% | |================================================================ | 91% | |================================================================ | 92% | |================================================================= | 92% | |================================================================= | 93% | |================================================================= | 94% | |================================================================== | 94% | |================================================================== | 95% | |=================================================================== | 95% | |=================================================================== | 96% | |==================================================================== | 96% | |==================================================================== | 97% | |==================================================================== | 98% | |===================================================================== | 98% | |===================================================================== | 99% | |======================================================================| 99% | |======================================================================| 100% plot(gridded_bathymetry)"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_coral_habitat.html","id":null,"dir":"Reference","previous_headings":"","what":"Get coral habitat suitability data — get_coral_habitat","title":"Get coral habitat suitability data — get_coral_habitat","text":"function extracts coral habitat suitability creates presence (1) absence (0) grids three groups deep-water coral species: antipatharia, cold water corals, octocorals.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_coral_habitat.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get coral habitat suitability data — get_coral_habitat","text":"","code":"get_coral_habitat( spatial_grid = NULL, raw = FALSE, antipatharia_threshold = 22, octocoral_threshold = 2, antimeridian = NULL )"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_coral_habitat.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get coral habitat suitability data — get_coral_habitat","text":"spatial_grid sf terra::rast() grid, e.g. created using get_grid(). Alternatively, raw data required, sf polygon can provided, e.g. created using get_boundary(), set raw = TRUE. raw logical TRUE, spatial_grid sf polygon, raw data polygon(s) returned antipatharia_threshold numeric 0 100; threshold value habitat suitability antipatharia corals considered present (default 22, defined Yesson et al., 2017) octocoral_threshold numeric 0 7; threshold value many species (7) predicted present area octocorals considered present (default 2) antimeridian spatial_grid span antimeridian? , set TRUE, otherwise set FALSE. set NULL (default) function try check spatial_grid spans antimeridian set appropriately.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_coral_habitat.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get coral habitat suitability data — get_coral_habitat","text":"area_polygon supplied, raster stack coral habitat suitability data returned; note raw habitat suitability/ . species values. spatial_grid supplied, raster stack sf gridded coral habitat presence/ absence data returned, depending spatial_grid format.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_coral_habitat.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get coral habitat suitability data — get_coral_habitat","text":"Habitat suitability data global Maxent species distribution models following species groups: Antipatharia: global extent black coral habiatat suitability modelled using Maxent. antipatharia habitat suitability converted presence/absence map \"choosing threshold value habitat suitability based maximum sum sensitivity specificity (threshold mss = 0.23)\" (Yesson et al. 2017). threshold can altered via function input. Data Yesson et al. 2017. Cold water corals: global habitat suitability five species Scleractinia modelled using Maxent. Presence defined using Maxent values lowest 10 percent values. Data Davies Guinotte 2011. Octocorals: global habitat suitability modelled 7 species cold-water octocoral found deeper 50m. Data described Yesson et al. 2012: \"consensus/summary map incorporating seven octocoral suborders constructed generating binary presence/absence maps model outputs indicating areas high suitability using score threshold maximized sum specificity sensitivity based validation data (Carroll, 2010). binary layers summed generate layer containing number octocoral suborders predicted present per cell.\"","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_coral_habitat.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get coral habitat suitability data — get_coral_habitat","text":"","code":"# Get EEZ data first bermuda_eez <- get_boundary(name = \"Bermuda\") #> Cache is fresh. Reading: /tmp/Rtmpvxs648/eez-2205f12f/eez.shp #> (Last Modified: 2025-01-10 06:44:54.084157) # Get raw coral habitat data coral_habitat <- get_coral_habitat(spatial_grid = bermuda_eez, raw = TRUE) terra::plot(coral_habitat) # Get gridded coral habitat data bermuda_grid <- get_grid(boundary = bermuda_eez, crs = '+proj=laea +lon_0=-64.8108333 +lat_0=32.3571917 +datum=WGS84 +units=m +no_defs', resolution = 10000) bermuda_coral_gridded <- get_coral_habitat(spatial_grid = bermuda_grid) terra::plot(bermuda_coral_gridded)"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_dist.html","id":null,"dir":"Reference","previous_headings":"","what":"Get distance to port or shore for a spatial grid — get_dist","title":"Get distance to port or shore for a spatial grid — get_dist","text":"Calculates distance shore, port anchorage grid cell provided spatial grid. Spatial grid can terra::rast() sf format.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_dist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get distance to port or shore for a spatial grid — get_dist","text":"","code":"get_dist( spatial_grid, dist_to = \"shore\", raw = FALSE, inverse = FALSE, name = NULL, antimeridian = NULL )"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_dist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get distance to port or shore for a spatial grid — get_dist","text":"spatial_grid sf terra::rast() grid, e.g. created using get_grid(). Alternatively, raw data required, sf polygon can provided, e.g. created using get_boundary(), set raw = TRUE. dist_to character data use calculate distance . Default \"shore\" (Natural Earth land polygons); possible values \"ports\" (WPI Ports), \"anchorages_land_masked\", \"anchorages_grouped\" \"anchorages_all\" (GFW anchorages). raw logical set TRUE retrieve raw shore, port anchorage data within extent spatial_grid. Note closest shore, port anchorage may outside extent. inverse logical set TRUE get inverse distance, .e. highest values become lowest vice versa. Can useful result used proxy fishing activity, closer grid cell port shore, fishing activity might . Default FALSE. name string; name raster column sf object returned antimeridian spatial_grid span antimeridian? , set TRUE, otherwise set FALSE. set NULL (default) function try check spatial_grid spans antimeridian set appropriately.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_dist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get distance to port or shore for a spatial grid — get_dist","text":"terra::rast sf object (type spatial_grid input) distance shore grid cell.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_dist.html","id":"shore","dir":"Reference","previous_headings":"","what":"Shore","title":"Get distance to port or shore for a spatial grid — get_dist","text":"Natural Earth high resolution land polygons used shoreline downloaded Natural Earth website (https://www.naturalearthdata.com/downloads/10m-physical-vectors/), internet connection required.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_dist.html","id":"ports","dir":"Reference","previous_headings":"","what":"Ports","title":"Get distance to port or shore for a spatial grid — get_dist","text":"Port locations downloaded directly World Port Index (Pub 150): https://msi.nga.mil/Publications/WPI.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_dist.html","id":"anchorages","dir":"Reference","previous_headings":"","what":"Anchorages","title":"Get distance to port or shore for a spatial grid — get_dist","text":"anchorages data Global Fishing Watch identifies anchorages anywhere vessels AIS remain stationary 12 hours (see https://globalfishingwatch.org/datasets--code-anchorages/). results large number points (~167,000). Calculating distance points grid cell computationally expensive. Anchorages close together names, reduce number anchorages, aggregated iso3 code (country code) label (name) mean longitude latitude coordinates obtained get one anchorage point per name country. data can used specifying dist_to = \"anchorages_grouped\". reduce number points, anchorages within countries' land boundaries, e.g. along rivers, can removed. buffering Natural Earth land boundaries 10km inland avoid cutting coastal anchorages fall within land boundary, due inaccuracies Natural Earth land boundaries, e.g. islands small scale coastlines, masking points fall within resulting polygons. data can used specifying dist_to = \"anchorages_land_masked\". full anchorages dataset can used specifying dist_to = \"anchorages_all\", option may take long time calculate / cause system hang.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_dist.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get distance to port or shore for a spatial grid — get_dist","text":"","code":"# Get some EEZ data first fiji_eez <- get_boundary(name = \"Fiji\") # Get a raster spatial grid for Fiji fiji_grid <- get_grid(boundary = fiji_eez, crs = 32760, resolution = 20000) #get distance from shore for each cell in the raster dist_from_shore_rast <- get_dist(fiji_grid) terra::plot(dist_from_shore_rast) #get distance to ports dist_ports <- get_dist(fiji_grid, dist_to = \"ports\") terra::plot(dist_ports) #get distance to anchorages, as defined by Global Fishing Watch data dist_anchorages <- get_dist(fiji_grid, dist_to = \"anchorages_land_masked\") terra::plot(dist_anchorages)"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_ecoregion.html","id":null,"dir":"Reference","previous_headings":"","what":"Get ecoregions — get_ecoregion","title":"Get ecoregions — get_ecoregion","text":"Gets ecoregion data spatial grid polygon","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_ecoregion.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get ecoregions — get_ecoregion","text":"","code":"get_ecoregion( spatial_grid = NULL, raw = FALSE, type = \"MEOW\", antimeridian = NULL )"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_ecoregion.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get ecoregions — get_ecoregion","text":"spatial_grid sf terra::rast() grid, e.g. created using get_grid(). Alternatively, raw data required, sf polygon can provided, e.g. created using get_boundary(), set raw = TRUE. raw logical TRUE, spatial_grid sf polygon, raw data polygon(s) returned type character ecoregion type required? Default \\\"MEOW\\\" (Marine Ecosystems World); possible values \\\"Longhurst\\\" \\\"LME\\\" antimeridian spatial_grid span antimeridian? , set TRUE, otherwise set FALSE. set NULL (default) function try check spatial_grid spans antimeridian set appropriately.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_ecoregion.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get ecoregions — get_ecoregion","text":"gridded data, multi-layer raster object, sf object depending spatial_grid format. raw = TRUE sf object Ecoregion.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_ecoregion.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get ecoregions — get_ecoregion","text":"Following ecoregions can obtained: Marine Ecosystems World dataset Longhurst Provinces Large Marine Ecosystems World data downloaded via mregions2 R package function mregions2::mrp_get(), information data can found Marine Regions website","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_ecoregion.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get ecoregions — get_ecoregion","text":"","code":"#' # Get EEZ data first bermuda_eez <- get_boundary(name = \"Bermuda\") #> Cache is fresh. Reading: /tmp/Rtmpvxs648/eez-2205f12f/eez.shp #> (Last Modified: 2025-01-10 06:44:54.084157) # Get Marine Ecoregions of the World data ecoregions <- get_ecoregion(spatial_grid = bermuda_eez, raw = TRUE) #> Spherical geometry (s2) switched off #> although coordinates are longitude/latitude, st_intersection assumes that they #> are planar #> Warning: attribute variables are assumed to be spatially constant throughout all geometries #> Spherical geometry (s2) switched on # Get Longhurst Provinces in a spatial grid bermuda_grid <- get_grid(boundary = bermuda_eez, crs = '+proj=laea +lon_0=-64.8108333 +lat_0=32.3571917 +datum=WGS84 +units=m +no_defs', resolution = 20000) longhurst_gridded <- get_ecoregion(spatial_grid = bermuda_grid, type = \"Longhurst\") #> Spherical geometry (s2) switched off #> although coordinates are longitude/latitude, st_intersection assumes that they #> are planar #> Warning: attribute variables are assumed to be spatially constant throughout all geometries #> Spherical geometry (s2) switched on"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_enviro_regions.html","id":null,"dir":"Reference","previous_headings":"","what":"Create environmental regions for area of interest — get_enviro_regions","title":"Create environmental regions for area of interest — get_enviro_regions","text":"function gets Bio-Oracle environmental data spatial grid can create environmental regions using k-means clustering. idea clustering comes Magris et al. 2020. number environmental regions can specified directly, using num_clusters, function can also find 'optimal' number clusters using NbClust() NbClust package.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_enviro_regions.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create environmental regions for area of interest — get_enviro_regions","text":"","code":"get_enviro_regions( spatial_grid = NULL, raw = FALSE, enviro_regions = TRUE, show_plots = FALSE, num_clusters = NULL, max_num_clusters = 6, antimeridian = NULL, sample_size = 5000, num_samples = 5, num_cores = 1, custom_seed = 1234 )"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_enviro_regions.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create environmental regions for area of interest — get_enviro_regions","text":"spatial_grid sf terra::rast() grid, e.g. created using get_grid(). Alternatively, raw data required, sf polygon can provided, e.g. created using get_boundary(), set raw = TRUE. raw logical TRUE, spatial_grid sf polygon, raw Bio-Oracle environmental data polygon(s) returned, unless enviro_regions = TRUE, case raw data classified environmental regions enviro_regions logical TRUE, environmental regions created. FALSE gridded Bio-Oracle data returned show_plots logical; whether show boxplots environmental variable environmental region (default FALSE) num_clusters numeric; number environmental regions cluster data - used clustering algorithm necessary (default NULL) max_num_clusters numeric; maximum number environmental regions try using clustering algorithm (default 6) antimeridian spatial_grid span antimeridian? , set TRUE, otherwise set FALSE. set NULL (default) function try check spatial_grid spans antimeridian set appropriately. sample_size numeric; default 5000. Larger sample sizes quickly consume memory (>10GB) used caution. num_samples numeric; default 5, resulted good consensus optimal number clusters testing. num_cores numeric; default 1. Multi-core sampling supported package parallel installed, aware increasing number cores also increase memory required. custom_seed numeric; default 1234, custom seed can supplied desired.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_enviro_regions.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create environmental regions for area of interest — get_enviro_regions","text":"enviro_regions = FALSE, Bio-Oracle data spatial_grid supplied, original raster file resolution raw = TRUE. enviro_regions = TRUE multi-layer raster sf object one environmental region column/ layer returned, depending spatial_grid format. enviro_regions = TRUE raw = TRUE (case spatial_grid sf polygon), raw Bio-Oracle data classified environmental zones.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_enviro_regions.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create environmental regions for area of interest — get_enviro_regions","text":"environmental data used clustering sea surface measurements period 2010 - 2020: Chlorophyll concentration (mean, mg/ m3) Dissolved oxygen concentration (mean) Nitrate concentration (mean, mmol/ m3) pH (mean) Phosphate concentration (mean, mmol/ m3) total Phytoplankton (primary productivity; mean, mmol/ m3) Salinity (mean) Sea surface temperature (max, degree C) Sea surface temperature (mean, degree C) Sea surface temperature (min, degree C) Silicate concentration (mean, mmol/ m3) full details Bio-Oracle data see Assis et al. 2024. number planning units/ cells clustering exceeds ~ 10,000, amount computer memory required find optimal number clusters using NbClust::NbClust() exceeds 10GB, repeated sampling used find consensus number clusters. Sensible defaults NbClust() provided, namely sample_size = 5000, num_samples = 5, max_num_clusters = 6 can customised desired, though see parameter descriptions words warning. Parallel processing offered specifying num_cores >1 (must integer), though package parallel must installed (included R installations). find number available cores systems run parallel::detectCores().","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_enviro_regions.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create environmental regions for area of interest — get_enviro_regions","text":"","code":"# Get EEZ data first bermuda_eez <- get_boundary(name = \"Bermuda\") #> Cache is fresh. Reading: /tmp/Rtmpvxs648/eez-2205f12f/eez.shp #> (Last Modified: 2025-01-10 06:44:54.084157) # Get raw Bio-Oracle environmental data for Bermuda enviro_data <- get_enviro_regions(spatial_grid = bermuda_eez, raw = TRUE, enviro_regions = FALSE) #> Selected dataset chl_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/chl_baseline_2000_2018_depthsurf.html #> Selected 1 variables: chl_mean #> Selected dataset o2_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/o2_baseline_2000_2018_depthsurf.html #> Selected 1 variables: o2_mean #> Selected dataset no3_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/no3_baseline_2000_2018_depthsurf.html #> Selected 1 variables: no3_mean #> Selected dataset thetao_baseline_2000_2019_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/thetao_baseline_2000_2019_depthsurf.html #> Selected 1 variables: thetao_min #> Selected dataset thetao_baseline_2000_2019_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/thetao_baseline_2000_2019_depthsurf.html #> Selected 1 variables: thetao_mean #> Selected dataset thetao_baseline_2000_2019_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/thetao_baseline_2000_2019_depthsurf.html #> Selected 1 variables: thetao_max #> Selected dataset ph_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/ph_baseline_2000_2018_depthsurf.html #> Selected 1 variables: ph_mean #> Selected dataset po4_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/po4_baseline_2000_2018_depthsurf.html #> Selected 1 variables: po4_mean #> Selected dataset so_baseline_2000_2019_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/so_baseline_2000_2019_depthsurf.html #> Selected 1 variables: so_mean #> Selected dataset si_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/si_baseline_2000_2018_depthsurf.html #> Selected 1 variables: si_mean #> Selected dataset phyc_baseline_2000_2020_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/phyc_baseline_2000_2020_depthsurf.html #> Selected 1 variables: phyc_mean terra::plot(enviro_data) # Get gridded Bio-Oracle data for Bermuda: bermuda_grid <- get_grid(boundary = bermuda_eez, crs = '+proj=laea +lon_0=-64.8108333 +lat_0=32.3571917 +datum=WGS84 +units=m +no_defs', resolution = 20000) enviro_data_gridded <- get_enviro_regions(spatial_grid = bermuda_grid, raw = FALSE, enviro_regions = FALSE) #> Selected dataset chl_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/chl_baseline_2000_2018_depthsurf.html #> Selected 1 variables: chl_mean #> Selected dataset o2_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/o2_baseline_2000_2018_depthsurf.html #> Selected 1 variables: o2_mean #> Selected dataset no3_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/no3_baseline_2000_2018_depthsurf.html #> Selected 1 variables: no3_mean #> Selected dataset thetao_baseline_2000_2019_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/thetao_baseline_2000_2019_depthsurf.html #> Selected 1 variables: thetao_min #> Selected dataset thetao_baseline_2000_2019_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/thetao_baseline_2000_2019_depthsurf.html #> Selected 1 variables: thetao_mean #> Selected dataset thetao_baseline_2000_2019_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/thetao_baseline_2000_2019_depthsurf.html #> Selected 1 variables: thetao_max #> Selected dataset ph_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/ph_baseline_2000_2018_depthsurf.html #> Selected 1 variables: ph_mean #> Selected dataset po4_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/po4_baseline_2000_2018_depthsurf.html #> Selected 1 variables: po4_mean #> Selected dataset so_baseline_2000_2019_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/so_baseline_2000_2019_depthsurf.html #> Selected 1 variables: so_mean #> Selected dataset si_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/si_baseline_2000_2018_depthsurf.html #> Selected 1 variables: si_mean #> Selected dataset phyc_baseline_2000_2020_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/phyc_baseline_2000_2020_depthsurf.html #> Selected 1 variables: phyc_mean terra::plot(enviro_data_gridded) # Get 3 environmental regions for Bermuda bermuda_enviro_regions <- get_enviro_regions(spatial_grid = bermuda_grid, raw = FALSE, enviro_regions = TRUE, num_clusters = 3) #> Selected dataset chl_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/chl_baseline_2000_2018_depthsurf.html #> Selected 1 variables: chl_mean #> Selected dataset o2_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/o2_baseline_2000_2018_depthsurf.html #> Selected 1 variables: o2_mean #> Selected dataset no3_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/no3_baseline_2000_2018_depthsurf.html #> Selected 1 variables: no3_mean #> Selected dataset thetao_baseline_2000_2019_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/thetao_baseline_2000_2019_depthsurf.html #> Selected 1 variables: thetao_min #> Selected dataset thetao_baseline_2000_2019_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/thetao_baseline_2000_2019_depthsurf.html #> Selected 1 variables: thetao_mean #> Selected dataset thetao_baseline_2000_2019_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/thetao_baseline_2000_2019_depthsurf.html #> Selected 1 variables: thetao_max #> Selected dataset ph_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/ph_baseline_2000_2018_depthsurf.html #> Selected 1 variables: ph_mean #> Selected dataset po4_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/po4_baseline_2000_2018_depthsurf.html #> Selected 1 variables: po4_mean #> Selected dataset so_baseline_2000_2019_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/so_baseline_2000_2019_depthsurf.html #> Selected 1 variables: so_mean #> Selected dataset si_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/si_baseline_2000_2018_depthsurf.html #> Selected 1 variables: si_mean #> Selected dataset phyc_baseline_2000_2020_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/phyc_baseline_2000_2020_depthsurf.html #> Selected 1 variables: phyc_mean terra::plot(bermuda_enviro_regions) # Can also create environmental regions from the raw Bio-Oracle data using setting raw = TRUE and enviro_regions = TRUE. In this case, the `spatial_grid` should be a polygon of the area you want the data for bermuda_enviro_regions2 <- get_enviro_regions(spatial_grid = bermuda_eez, raw = TRUE, enviro_regions = TRUE, num_clusters = 3) #> Selected dataset chl_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/chl_baseline_2000_2018_depthsurf.html #> Selected 1 variables: chl_mean #> Selected dataset o2_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/o2_baseline_2000_2018_depthsurf.html #> Selected 1 variables: o2_mean #> Selected dataset no3_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/no3_baseline_2000_2018_depthsurf.html #> Selected 1 variables: no3_mean #> Selected dataset thetao_baseline_2000_2019_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/thetao_baseline_2000_2019_depthsurf.html #> Selected 1 variables: thetao_min #> Selected dataset thetao_baseline_2000_2019_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/thetao_baseline_2000_2019_depthsurf.html #> Selected 1 variables: thetao_mean #> Selected dataset thetao_baseline_2000_2019_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/thetao_baseline_2000_2019_depthsurf.html #> Selected 1 variables: thetao_max #> Selected dataset ph_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/ph_baseline_2000_2018_depthsurf.html #> Selected 1 variables: ph_mean #> Selected dataset po4_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/po4_baseline_2000_2018_depthsurf.html #> Selected 1 variables: po4_mean #> Selected dataset so_baseline_2000_2019_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/so_baseline_2000_2019_depthsurf.html #> Selected 1 variables: so_mean #> Selected dataset si_baseline_2000_2018_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/si_baseline_2000_2018_depthsurf.html #> Selected 1 variables: si_mean #> Selected dataset phyc_baseline_2000_2020_depthsurf. #> Dataset info available at: http://erddap.bio-oracle.org/erddap/griddap/phyc_baseline_2000_2020_depthsurf.html #> Selected 1 variables: phyc_mean terra::plot(bermuda_enviro_regions2)"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_features.html","id":null,"dir":"Reference","previous_headings":"","what":"Get a set of feature data for a spatial grid — get_features","title":"Get a set of feature data for a spatial grid — get_features","text":"wrapper get_bathymetry(), get_seamounts_buffered(), get_knolls(), get_geomorphology(), get_coral_habitat(), get_enviro_regions(). See individual functions details.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_features.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get a set of feature data for a spatial grid — get_features","text":"","code":"get_features( spatial_grid = NULL, raw = FALSE, features = c(\"bathymetry\", \"seamounts\", \"knolls\", \"geomorphology\", \"corals\", \"enviro_regions\"), bathy_resolution = 1, seamount_buffer = 30000, antipatharia_threshold = 22, octocoral_threshold = 2, enviro_clusters = NULL, max_enviro_clusters = 6, antimeridian = NULL )"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_features.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get a set of feature data for a spatial grid — get_features","text":"spatial_grid sf terra::rast() grid, e.g. created using get_grid(). Alternatively, raw data required, sf polygon can provided, e.g. created using get_boundary(), set raw = TRUE. raw logical TRUE, spatial_grid sf polygon, raw feature data polygon(s) returned. Note list object, since raster sf data may returned. features vector feature names, can include: \"bathymetry\", \"seamounts\", \"knolls\", \"geomorphology\", \"corals\", \"enviro_regions\" bathy_resolution numeric; resolution (minutes) data pull ETOPO 2022 Global Relief model. Values less 1 can 0.5 (30 arc seconds) 0.25 (15 arc seconds) seamount_buffer numeric; distance seamount peak include output. Distance units area_polygon spatial_grid provided, use e.g. sf::st_crs(spatial_grid, parameters = TRUE)$units_gdal check units planning grid area polygon (works raster well sf objects) antipatharia_threshold numeric 0 100; threshold value habitat suitability antipatharia corals considered present (default 22, defined Yesson et al., 2017) octocoral_threshold numeric 0 7; threshold value many species (7) predicted present area octocorals considered present (default 2) enviro_clusters numeric; number environmental regions cluster data - used clustering algorithm necessary (default NULL) max_enviro_clusters numeric; maximum number environmental regions try using clustering algorithm (default 8) antimeridian spatial_grid span antimeridian? , set TRUE, otherwise set FALSE. set NULL (default) function try check spatial_grid spans antimeridian set appropriately.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_features.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get a set of feature data for a spatial grid — get_features","text":"raw = TRUE, list feature data returned (mixed raster sf objects). spatial_grid supplied, multi-layer raster sf object gridded data returned, depending spatial_grid format.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_features.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get a set of feature data for a spatial grid — get_features","text":"","code":"# Grab EEZ data first bermuda_eez <- get_boundary(name = \"Bermuda\") #> Cache is fresh. Reading: /tmp/Rtmpvxs648/eez-2205f12f/eez.shp #> (Last Modified: 2025-01-10 06:44:54.084157) # Get raw data for Bermuda's EEZ raw_data <- get_features(spatial_grid = bermuda_eez, raw = TRUE) #> Getting depth zones... #> This may take seconds to minutes, depending on grid size #> Getting seamount data... #> Spherical geometry (s2) switched off #> although coordinates are longitude/latitude, st_intersection assumes that they #> are planar #> Warning: attribute variables are assumed to be spatially constant throughout all geometries #> Warning: st_buffer does not correctly buffer longitude/latitude data #> dist is assumed to be in decimal degrees (arc_degrees). #> Spherical geometry (s2) switched on #> Getting knoll data... #> Spherical geometry (s2) switched off #> although coordinates are longitude/latitude, st_intersection assumes that they #> are planar #> Warning: attribute variables are assumed to be spatially constant throughout all geometries #> Spherical geometry (s2) switched on #> Getting geomorphology data... #> Getting coral data... #> Getting environmental regions data... This could take several minutes # Get feature data in a spatial grid bermuda_grid <- get_grid(boundary = bermuda_eez, crs = '+proj=laea +lon_0=-64.8108333 +lat_0=32.3571917 +datum=WGS84 +units=m +no_defs', resolution = 20000) features_gridded <- get_features(spatial_grid = bermuda_grid) #> Getting depth zones... #> This may take seconds to minutes, depending on grid size #> Getting seamount data... #> Spherical geometry (s2) switched off #> although coordinates are longitude/latitude, st_intersection assumes that they #> are planar #> Warning: attribute variables are assumed to be spatially constant throughout all geometries #> Spherical geometry (s2) switched on #> Getting knoll data... #> Spherical geometry (s2) switched off #> although coordinates are longitude/latitude, st_intersection assumes that they #> are planar #> Warning: attribute variables are assumed to be spatially constant throughout all geometries #> Spherical geometry (s2) switched on #> Getting geomorphology data... #> Getting coral data... #> Getting environmental regions data... This could take several minutes terra::plot(features_gridded)"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_geomorphology.html","id":null,"dir":"Reference","previous_headings":"","what":"Get seafloor geomorphology data — get_geomorphology","title":"Get seafloor geomorphology data — get_geomorphology","text":"Get geomorphological data spatial grid polygon","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_geomorphology.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get seafloor geomorphology data — get_geomorphology","text":"","code":"get_geomorphology(spatial_grid = NULL, raw = FALSE, antimeridian = NULL)"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_geomorphology.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get seafloor geomorphology data — get_geomorphology","text":"spatial_grid sf terra::rast() grid, e.g. created using get_grid(). Alternatively, raw data required, sf polygon can provided, e.g. created using get_boundary(), set raw = TRUE. raw logical TRUE, spatial_grid sf polygon, raw data polygon(s) returned antimeridian spatial_grid span antimeridian? , set TRUE, otherwise set FALSE. set NULL (default) function try check spatial_grid spans antimeridian set appropriately.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_geomorphology.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get seafloor geomorphology data — get_geomorphology","text":"gridded data, multi-layer raster object, sf object geomorphology class column, depending spatial_grid format. raw = TRUE sf object row different geomorphological feature.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_geomorphology.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get seafloor geomorphology data — get_geomorphology","text":"Geomorphological features Harris et al. 2014 dataset, available https://www.bluehabitats.org. Data included package, except depth classification features can created using get_bathymetry() seamounts can retrieved recent dataset using get_seamounts(). List features: Abyssal hills Abyssal plains Basins: large basins seas oceans major ocean basins perched shelf perched slope small basins seas oceans Bridges Canyons: blind shelf incising Escarpments Fans Glacial troughs Guyots Plateaus Ridges Rift valleys Rises Shelf valleys: large shelf valleys glacial troughs moderate size small Sills Spreading ridges Terraces Trenches Troughs","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_geomorphology.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get seafloor geomorphology data — get_geomorphology","text":"","code":"# Grab EEZ data first bermuda_eez <- get_boundary(name = \"Bermuda\") #> Cache is fresh. Reading: /tmp/Rtmpvxs648/eez-2205f12f/eez.shp #> (Last Modified: 2025-01-10 06:44:54.084157) # Get geomorphology for the EEZ bermuda_geomorph <- get_geomorphology(spatial_grid = bermuda_eez, raw = TRUE) #> Spherical geometry (s2) switched off #> although coordinates are longitude/latitude, st_intersection assumes that they #> are planar #> Spherical geometry (s2) switched on plot(bermuda_geomorph) # Get geomorphological features in spatial_grid bermuda_grid <- get_grid(boundary = bermuda_eez, crs = '+proj=laea +lon_0=-64.8108333 +lat_0=32.3571917 +datum=WGS84 +units=m +no_defs', resolution = 20000) geomorph_gridded <- get_geomorphology(spatial_grid = bermuda_grid) #> Spherical geometry (s2) switched off #> although coordinates are longitude/latitude, st_intersection assumes that they #> are planar #> Spherical geometry (s2) switched on"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_gfw.html","id":null,"dir":"Reference","previous_headings":"","what":"Get data from Global Fishing Watch — get_gfw","title":"Get data from Global Fishing Watch — get_gfw","text":"Global Fishing Watch (GFW) provides data apparent fishing effort (hours) 0.01 degree spatial resolution, based automatic identification system (AIS) broadcasts vessels. Data principally larger vessel (> 24m length); less 1% vessels <12 m length represented data (see GFW website detailed information). function primarily wrapper gfwr package function get_raster(), allows user return multiple years data summarized gridded format. API key required retrieve GFW data; see package website instructions get save one (free).","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_gfw.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get data from Global Fishing Watch — get_gfw","text":"","code":"get_gfw( spatial_grid = NULL, raw = FALSE, resolution = \"LOW\", start_year = 2018, end_year = 2023, group_by = \"location\", summarise = \"mean_total_annual_effort\", key = gfwr::gfw_auth() )"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_gfw.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get data from Global Fishing Watch — get_gfw","text":"spatial_grid sf terra::rast() grid, e.g. created using get_grid(). Alternatively, raw data required, sf polygon can provided, e.g. created using get_boundary(), set raw = TRUE. raw logical TRUE, spatial_grid can sf polygon, raw GFW data, tibble format, returned bounding box covering polygon +/-1 degree. bounding box expanded ensure entire polygon data coverage point data rasterized. data summarised, .e. summarise ignored. resolution string either \"HIGH\" = 0.01 degree spatial resolution, \"LOW\" = 0.1. start_year numeric must 2012 recent year. Note GFW added data Spire Orbcomm AIS providers 2017, data 2017 likely greater spatial temporal coverage (Welch et al. 2022). end_year numeric year 2012 current year group_by string can \"geartype\", \"flag\", \"location\". summarise string can \"total_annual_effort\"; sum fishing effort years, start_year end_year location returned, grouped group_by; \"mean_total_annual_effort\"; mean annual sums fishing effort years location returned, grouped group_by. key string Authorization token. Can obtained gfw_auth() function. See gfwr website details request token.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_gfw.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get data from Global Fishing Watch — get_gfw","text":"gridded data, terra::rast() sf object, depending spatial_grid format. raw = TRUE, non-summarised data tibble format returned polygon area direct GFW query gfwr::get_raster().","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_gfw.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get data from Global Fishing Watch — get_gfw","text":"","code":"if (FALSE) { # nchar(Sys.getenv(\"GFW_TOKEN\")) > 0 #get mean total annual fishing effort for Bermuda for the years 2022-2023 #first get a grid for Bermuda bermuda_grid <- get_boundary(name = \"Bermuda\") %>% get_grid(resolution = 0.1, crs = 4326) bermuda_gfw_effort <- get_gfw(spatial_grid = bermuda_grid, start_year = 2022) #plot the data terra::plot(bermuda_gfw_effort) #get total fishing effort for each gear type in Fiji's EEZ for 2022 fiji_grid <- get_boundary(name = \"Fiji\") %>% get_grid(resolution = 1e4, crs = \"+proj=tcea +lon_0=178 +datum=WGS84 +units=m +no_defs\", output = \"sf_square\") fiji_gfw_effort <- get_gfw(spatial_grid = fiji_grid, start_year = 2022, end_year = 2022, group_by = \"geartype\", summarise = \"total_annual_effort\") plot(fiji_gfw_effort, border = FALSE) #quantile is better for viewing the fishing effort distribution due to the long tail of values plot(fiji_gfw_effort[1], border= FALSE, breaks = \"quantile\") }"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_knolls.html","id":null,"dir":"Reference","previous_headings":"","what":"Get knolls base areas — get_knolls","title":"Get knolls base areas — get_knolls","text":"Get knolls base area data spatial grid polygon","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_knolls.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get knolls base areas — get_knolls","text":"","code":"get_knolls( spatial_grid = NULL, raw = FALSE, name = \"knolls\", antimeridian = NULL )"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_knolls.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get knolls base areas — get_knolls","text":"spatial_grid sf terra::rast() grid, e.g. created using get_grid(). Alternatively, raw data required, sf polygon can provided, e.g. created using get_boundary(), set raw = TRUE. raw logical TRUE, spatial_grid sf polygon, raw data polygon(s) returned name string; name raster column sf object returned antimeridian spatial_grid span antimeridian? , set TRUE, otherwise set FALSE. set NULL (default) function try check spatial_grid spans antimeridian set appropriately.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_knolls.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get knolls base areas — get_knolls","text":"gridded data, terra::rast() sf object, depending spatial_grid format. raw = TRUE sf object crop intersected polygon supplied.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_knolls.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get knolls base areas — get_knolls","text":"Knolls small seamounts; seamounts peaks 200-1000 m higher surrounding seafloor (Morato et al., 2008). knolls base area data Yesson et al. 2011","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_knolls.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get knolls base areas — get_knolls","text":"","code":"# Get EEZ data first bermuda_eez <- get_boundary(name = \"Bermuda\") #> Cache is fresh. Reading: /tmp/Rtmpvxs648/eez-2205f12f/eez.shp #> (Last Modified: 2025-01-10 06:44:54.084157) # Get raw knolls data for Bermuda's EEZ knolls <- get_knolls(spatial_grid= bermuda_eez, raw = TRUE) #> Spherical geometry (s2) switched off #> although coordinates are longitude/latitude, st_intersection assumes that they #> are planar #> Warning: attribute variables are assumed to be spatially constant throughout all geometries #> Spherical geometry (s2) switched on # Get gridded knolls data: first create a grid bermuda_grid <- get_grid(boundary = bermuda_eez, crs = '+proj=laea +lon_0=-64.8108333 +lat_0=32.3571917 +datum=WGS84 +units=m +no_defs', resolution = 10000) knolls_gridded <- get_knolls(spatial_grid = bermuda_grid) #> Spherical geometry (s2) switched off #> although coordinates are longitude/latitude, st_intersection assumes that they #> are planar #> Warning: attribute variables are assumed to be spatially constant throughout all geometries #> Spherical geometry (s2) switched on"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_seamounts.html","id":null,"dir":"Reference","previous_headings":"","what":"Get seamounts — get_seamounts","title":"Get seamounts — get_seamounts","text":"Get seamounts data spatial grid polygon","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_seamounts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get seamounts — get_seamounts","text":"","code":"get_seamounts( spatial_grid = NULL, raw = FALSE, buffer = NULL, name = \"seamounts\", antimeridian = NULL )"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_seamounts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get seamounts — get_seamounts","text":"spatial_grid sf terra::rast() grid, e.g. created using get_grid(). Alternatively, raw data required, sf polygon can provided, e.g. created using get_boundary(), set raw = TRUE. raw logical TRUE, spatial_grid sf polygon, raw data polygon(s) returned buffer numeric; distance seamount peak include output. Distance units spatial_grid, use e.g. sf::st_crs(spatial_grid, parameters = TRUE)$units_gdal check units. buffering raw data, units metres, unless sf::sf_use_s2() set FALSE, case units degrees. name string; name raster column sf object returned antimeridian spatial_grid span antimeridian? , set TRUE, otherwise set FALSE. set NULL (default) function try check spatial_grid spans antimeridian set appropriately.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_seamounts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get seamounts — get_seamounts","text":"buffered seamounts gridded data, terra::rast() sf object, depending spatial_grid format. raw = TRUE buffer = NULL sf POINT geometry object seamount peaks within polygon provided. raw = TRUE buffer NULL sf polygon geometry object buffered seamount peaks within polygon provided. Note: present, possible return gridded seamount peaks: https://github.com/emlab-ucsb/oceandatr/issues/48","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_seamounts.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get seamounts — get_seamounts","text":"Seamounts classified peaks least 1000m higher surrounding seafloor Morato et al. 2008. seamounts peak dataset Yeson et al. 2021. Morato et al. 2010 found seamounts higher biodiversity within 30 - 40 km peak. enable radius higher biodiversity included conservation planning, buffer argument can set, seamount peak buffered radius specified","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/get_seamounts.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get seamounts — get_seamounts","text":"","code":"# Get EEZ data first bermuda_eez <- get_boundary(name = \"Bermuda\") #> Cache is fresh. Reading: /tmp/Rtmpvxs648/eez-2205f12f/eez.shp #> (Last Modified: 2025-01-10 06:44:54.084157) # Get raw seamounts data seamount_peaks <- get_seamounts(spatial_grid = bermuda_eez, raw = TRUE) #> Spherical geometry (s2) switched off #> although coordinates are longitude/latitude, st_intersection assumes that they #> are planar #> Warning: attribute variables are assumed to be spatially constant throughout all geometries #> Spherical geometry (s2) switched on plot(seamount_peaks[\"Depth\"]) # Get gridded seamount data bermuda_grid <- get_grid(boundary = bermuda_eez, crs = '+proj=laea +lon_0=-64.8108333 +lat_0=32.3571917 +datum=WGS84 +units=m +no_defs', resolution = 10000) #buffer seamounts to a distance of 30 km (30,000 m) seamounts_gridded <- get_seamounts(spatial_grid = bermuda_grid, buffer = 30000) #> Spherical geometry (s2) switched off #> although coordinates are longitude/latitude, st_intersection assumes that they #> are planar #> Warning: attribute variables are assumed to be spatially constant throughout all geometries #> Spherical geometry (s2) switched on terra::plot(seamounts_gridded)"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/oceandatr-package.html","id":null,"dir":"Reference","previous_headings":"","what":"oceandatr: Ocean Data Access — oceandatr-package","title":"oceandatr: Ocean Data Access — oceandatr-package","text":"retrieving gridding ocean related data.","code":""},{"path":[]},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/oceandatr-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"oceandatr: Ocean Data Access — oceandatr-package","text":"Maintainer: Jason Flower jflower@ucsb.edu (ORCID)","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/pipe.html","id":null,"dir":"Reference","previous_headings":"","what":"Pipe operator — %>%","title":"Pipe operator — %>%","text":"See magrittr::%>% details.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/pipe.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pipe operator — %>%","text":"","code":"lhs %>% rhs"},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/pipe.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Pipe operator — %>%","text":"lhs value magrittr placeholder. rhs function call using magrittr semantics.","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/pipe.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Pipe operator — %>%","text":"result calling rhs(lhs).","code":""},{"path":"https://emlab-ucsb.github.io/oceandatr/reference/reexports.html","id":null,"dir":"Reference","previous_headings":"","what":"Objects exported from other packages — reexports","title":"Objects exported from other packages — reexports","text":"objects imported packages. Follow links see documentation. spatialgridr get_boundary, get_data_in_grid, get_grid","code":""}]