Get a coverage from an EMODnet WCS Service
Usage
emdn_get_coverage(
wcs = NULL,
service = NULL,
coverage_id,
service_version = c("2.0.1", "2.1.0", "2.0.0", "1.1.1", "1.1.0"),
logger = c("NONE", "INFO", "DEBUG"),
bbox = NULL,
crs = "EPSG:4326",
time = NULL,
elevation = NULL,
format = NULL,
rangesubset = NULL,
filename = NULL,
nil_values_as_na = FALSE
)Arguments
- wcs
A
WCSClientR6 object, created with functionemdn_init_wcs_client.- service
the EMODnet OGC WCS service name. For available services, see
emdn_wcs().- coverage_id
character string. Coverage ID. Inspect your
wcsobject for available coverages.- service_version
the WCS service version. Defaults to "2.0.1".
- logger
character string. Level of logger: 'NONE' for no logger, 'INFO' to get ows4R logs, 'DEBUG' for all internal logs (such as as Curl details)
- bbox
a named numeric vector of length 4, with names
xmin,ymin,xmaxandymax, specifying the bounding box (extent) of the raster to be returned. Can also be an object that can be coerced to abboxobject withsf::st_bbox().- crs
the CRS of the supplied bounding box (EPSG prefixed code, or URI/URN). Defaults to
"EPSG:4326". It will be ignored when the CRS is already defined for argumentbbox.- time
for coverages that include a temporal dimension, a vector of temporal coefficients specifying the time points for which coverage data should be returned. If
NULL(default), the last time point is returned. To get a list of all available temporal coefficients, seeemdn_get_coverage_dim_coefs. For a single time point, aSpatRasteris returned. For more than one time points,SpatRasterstack is returned.- elevation
for coverages that include a vertical dimension, a vector of vertical coefficients specifying the elevation for which coverage data should be returned. If
NULL(default), the last elevation is returned. To get a list of all available vertical coefficients, seeemdn_get_coverage_dim_coefs. For a single elevation, aSpatRasteris returned. For more than one elevation,SpatRasterstack is returned.- format
the format of the file the coverage should be written out to.
- rangesubset
character vector of band descriptions to subset.
- filename
the file name to write to.
- nil_values_as_na
logical. Should raster nil values be converted to
NA?
Value
an object of class terra::SpatRaster. The function also
writes the coverage to a local file.
Examples
if (FALSE) { # \dontrun{
wcs <- emdn_init_wcs_client(service = "biology")
coverage_id <- "Emodnetbio__cal_fin_19582016_L1_err"
# Subset using a bounding box
emdn_get_coverage(wcs,
coverage_id = coverage_id,
bbox = c(
xmin = 0, ymin = 40,
xmax = 5, ymax = 45
)
)
# Subset using a bounding box and specific timepoints
emdn_get_coverage(wcs,
coverage_id = coverage_id,
bbox = c(
xmin = 0, ymin = 40,
xmax = 5, ymax = 45
),
time = c(
"1963-11-16T00:00:00.000Z",
"1964-02-16T00:00:00.000Z"
)
)
# Subset using a bounding box and a specific band
emdn_get_coverage(wcs,
coverage_id = coverage_id,
bbox = c(
xmin = 0, ymin = 40,
xmax = 5, ymax = 45
),
rangesubset = "Relative abundance"
)
} # }