
Get ecoregions
get_ecoregion.RdGets ecoregion data for a spatial grid or polygon
Arguments
- spatial_grid
sforterra::rast()grid, e.g. created usingget_grid(). Alternatively, if raw data is required, ansfpolygon can be provided, e.g. created usingget_boundary(), and setraw = TRUE.- raw
logicalif TRUE,spatial_gridshould be ansfpolygon, and the raw data in that polygon(s) will be returned- type
characterwhich ecoregion type is required? Default is\"MEOW\"(Marine Ecosystems of the World); other possible values are\"Longhurst\",\"LME\", and\"meso\"- antimeridian
Does
spatial_gridspan the antimeridian? If so, this should be set toTRUE, otherwise set toFALSE. If set toNULL(default) the function will try to check ifspatial_gridspans the antimeridian and set this appropriately.
Value
For gridded data, a multi-layer raster object, or an sf object
depending on the spatial_grid format. If raw = TRUE an sf object of
the Ecoregion.
Details
The Following ecoregions can be obtained:
Marine Ecosystems of the World dataset
-
All data are downloaded via the Marine Regions website
Examples
#' # Get EEZ data first
bermuda_eez <- get_boundary(name = "Bermuda")
# 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