| Title: | Access EMODnet Web Coverage Service data through R |
|---|---|
| Description: | Access and interrogate EMODnet Web Coverage Service data through R. |
| Authors: | Anna Krystalli [aut] (ORCID: <https://orcid.org/0000-0002-2378-4915>), Salvador Fernández-Bejarano [cre] (ORCID: <https://orcid.org/0000-0003-0535-7677>), European Marine Observation Data Network (EMODnet) Biology project European Commission's Directorate - General for Maritime Affairs and Fisheries (DG MARE) [cph], VLIZ (VLAAMS INSTITUUT VOOR DE ZEE) [fnd] (ROR: <https://ror.org/0496vr396>), Pepijn de Vries [ctb] (ORCID: <https://orcid.org/0000-0002-7961-6646>), Maëlle Salmon [aut] (ORCID: <https://orcid.org/0000-0002-2815-0399>) |
| Maintainer: | Salvador Fernández-Bejarano <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.0.1.9000 |
| Built: | 2026-05-20 10:16:02 UTC |
| Source: | https://github.com/EMODnet/emodnet.wcs |
Get coverage metadata from a <WCSCoverageSummary> object.
emdn_get_bbox(summary) emdn_get_WGS84bbox(summary) emdn_get_band_nil_values(summary, band = NULL) emdn_get_band_descriptions(summary) emdn_get_band_uom(summary) emdn_get_band_constraints(summary) emdn_get_grid_size(summary) emdn_get_resolution(summary) emdn_get_coverage_function(summary) emdn_get_temporal_extent(summary) emdn_get_vertical_extent(summary) emdn_get_dimensions_info( summary, format = c("character", "list", "tibble"), include_coeffs = FALSE ) emdn_get_dimensions_names(summary) emdn_get_dimensions_n(summary) emdn_get_dimension_types(summary)emdn_get_bbox(summary) emdn_get_WGS84bbox(summary) emdn_get_band_nil_values(summary, band = NULL) emdn_get_band_descriptions(summary) emdn_get_band_uom(summary) emdn_get_band_constraints(summary) emdn_get_grid_size(summary) emdn_get_resolution(summary) emdn_get_coverage_function(summary) emdn_get_temporal_extent(summary) emdn_get_vertical_extent(summary) emdn_get_dimensions_info( summary, format = c("character", "list", "tibble"), include_coeffs = FALSE ) emdn_get_dimensions_names(summary) emdn_get_dimensions_n(summary) emdn_get_dimension_types(summary)
summary |
a |
band |
Character vector of bands. By default all bands. |
format |
character string. Coverage dimension info output format.
One of |
include_coeffs |
whether to include a vector of temporal or vertical
dimension coefficients (if applicable) in the coverage dimension info
|
emdn_get_bbox: an object of class bbox of length 4 expressing the
boundaries coverage extent/envelope. See sf::st_bbox() for more details.
emdn_get_WGS84bbox: an object of class bbox of length 4 expressing the
boundaries coverage extent/envelope. See sf::st_bbox() for more details.
emdn_get_band_nil_values a numeric scalar of the value representing nil values
in a coverage.
emdn_get_band_descriptions a character vector of band descriptions.
emdn_get_band_uom a character vector of band units of measurement.
emdn_get_band_constraints a list of numeric vectors of length 2 indicating the min and max
values of the data contained in each bands of the coverage.
emdn_get_grid_size a numeric vector of length 2 giving the spatial size in
grid cells (pixels) of the coverage grid (ncol x nrow)
emdn_get_resolution a numeric vector of length 2 giving the spatial resolution
of grid cells (size in the x dimension, size in the y dimension) of a coverage. The attached attribute uom gives the units of
measurement of each dimension.
emdn_get_coverage_function a list with elements:
sequence_rule, character string, the function describing the sequence
rule, i.e. the relationship between the axes of data and coordinate system
axes.
starting_point a numeric vector of length 2, the location of the origin
of the data in the coordinate system.
axis_order a character vector of length 2 specifying the axis order and
direction of mapping of values onto the grid, beginning at the starting point. For
example, "+2 +1" indicates the value range is ordered from the bottom
left to the top right of the grid envelope - lowest to highest in the x-axis
direction first (+2), then lowest to highest in the y-axis direction (+1)
from the starting_point.
emdn_get_temporal_extent if the coverage has a temporal dimension, a numeric
vector of length 2 giving the min and max values of the dimension.
Otherwise, NA.
emdn_get_vertical_extent if the coverage has a vertical dimension, a numeric
vector of length 2 giving the min and max values of the dimension.
Otherwise, NA.
emdn_get_dimensions_info output depends on format argument:
character: (default) a concatenated character string of dimension
information
list: a list of dimension information
tibble: a tibble of dimension information
emdn_get_bbox(): Get the announced bounding box (geographic extent) of a
coverage. Coordinates are given in the same Coordinate Reference System
as the coverage. The bounding box is approximate and may overestimate coverage.
emdn_get_WGS84bbox(): Get the announced bounding box (geographic extent) of a
coverage in World Geodetic System 1984 (WGS84) Coordinate Reference System
(or EPSG:4326). The bounding box is approximate and may overestimate coverage.
emdn_get_band_nil_values(): Get the value representing nil values in a
coverage.
emdn_get_band_descriptions(): Get the band descriptions of a coverage.
emdn_get_band_uom(): Get the units of measurement of the data contained in
the bands values of a coverage.
emdn_get_band_constraints(): Get the range of values of the data allowed in
the bands of the coverage, for requests.
emdn_get_grid_size(): Get the grid size of a coverage.
emdn_get_resolution(): Get the resolution of a coverage.
emdn_get_coverage_function(): Get the grid function of a coverage.
emdn_get_temporal_extent(): Get the temporal extent of a coverage.
emdn_get_vertical_extent(): Get the vertical (elevation) extent of a coverage.
emdn_get_dimensions_info(): Get information on dimensions of a coverage in
various formats. Information includes dimension label, type, unit and
range (in tibble format).
emdn_get_dimensions_names(): Get coverage dimension names (labels) and units.
emdn_get_dimensions_n(): Get number of coverage dimensions.
emdn_get_dimension_types(): Get dimensions types of a coverage.
wcs <- emdn_init_wcs_client(service = "biology") summary <- emdn_get_coverage_summaries(wcs, "Emodnetbio__ratio_large_to_small_19582016_L1_err")[[1]] # get bbox emdn_get_bbox(summary) # get WGS84 bbox emdn_get_WGS84bbox(summary) # get the nil value of a coverage emdn_get_band_nil_values(summary) # get coverage band descriptions emdn_get_band_descriptions(summary) # get band units of measurement emdn_get_band_uom(summary) # get range of band values emdn_get_band_constraints(summary) # get coverage grid size emdn_get_grid_size(summary) # get coverage resolution emdn_get_resolution(summary) # get coverage grid function emdn_get_coverage_function(summary) # get the extent of the temporal dimension emdn_get_temporal_extent(summary) # get the extent of the vertical dimension emdn_get_vertical_extent(summary) # get information about coverage dimensions in various formats emdn_get_dimensions_info(summary) emdn_get_dimensions_info(summary, format = "list") emdn_get_dimensions_info(summary, format = "tibble") # get dimension names emdn_get_dimensions_names(summary) # get number of dimensions emdn_get_dimensions_n(summary) # get dimensions types emdn_get_dimension_types(summary)wcs <- emdn_init_wcs_client(service = "biology") summary <- emdn_get_coverage_summaries(wcs, "Emodnetbio__ratio_large_to_small_19582016_L1_err")[[1]] # get bbox emdn_get_bbox(summary) # get WGS84 bbox emdn_get_WGS84bbox(summary) # get the nil value of a coverage emdn_get_band_nil_values(summary) # get coverage band descriptions emdn_get_band_descriptions(summary) # get band units of measurement emdn_get_band_uom(summary) # get range of band values emdn_get_band_constraints(summary) # get coverage grid size emdn_get_grid_size(summary) # get coverage resolution emdn_get_resolution(summary) # get coverage grid function emdn_get_coverage_function(summary) # get the extent of the temporal dimension emdn_get_temporal_extent(summary) # get the extent of the vertical dimension emdn_get_vertical_extent(summary) # get information about coverage dimensions in various formats emdn_get_dimensions_info(summary) emdn_get_dimensions_info(summary, format = "list") emdn_get_dimensions_info(summary, format = "tibble") # get dimension names emdn_get_dimensions_names(summary) # get number of dimensions emdn_get_dimensions_n(summary) # get dimensions types emdn_get_dimension_types(summary)
Get a coverage from an EMODnet WCS Service
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 )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 )
wcs |
A |
service |
the EMODnet OGC WCS service name.
For available services, see |
coverage_id |
character string. Coverage ID. Inspect your
|
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 |
crs |
the CRS of the supplied bounding box
(EPSG prefixed code, or URI/URN).
Defaults to |
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 |
elevation |
for coverages that include a vertical dimension,
a vector of vertical coefficients specifying the
elevation for which coverage data should be returned.
If |
format |
the format of the file the coverage should be written out to. |
rangesubset |
character vector of band descriptions to subset. Can work better if you use a bounding box (https://github.com/eblondel/ows4R/issues/147). |
filename |
the file name to write to. |
nil_values_as_na |
logical. Should raster nil values be converted to |
an object of class terra::SpatRaster. The function also
writes the coverage to a local file.
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( "1958-02-16T01:00:00", "1958-05-16T01:00:00" ) ) # Subset using a bounding box and a specific band north_sea_bbox <- c(xmin = -4, ymin = 50, xmax = 10, ymax = 62) emdn_get_coverage(wcs, coverage_id = coverage_id, bbox = north_sea_bbox, rangesubset = "Relative abundance" )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( "1958-02-16T01:00:00", "1958-05-16T01:00:00" ) ) # Subset using a bounding box and a specific band north_sea_bbox <- c(xmin = -4, ymin = 50, xmax = 10, ymax = 62) emdn_get_coverage(wcs, coverage_id = coverage_id, bbox = north_sea_bbox, rangesubset = "Relative abundance" )
Get metadata objects from a WCSClient object. <WCSCoverageSummary>
in particular can be used to extract further metadata about individual
coverages.
emdn_get_coverage_summaries(wcs, coverage_ids) emdn_get_coverage_summaries_all(wcs) emdn_get_coverage_ids(wcs) emdn_has_dimension(wcs, coverage_ids, type = c("temporal", "vertical")) emdn_get_coverage_dim_coefs( wcs, coverage_ids, type = c("temporal", "vertical") )emdn_get_coverage_summaries(wcs, coverage_ids) emdn_get_coverage_summaries_all(wcs) emdn_get_coverage_ids(wcs) emdn_has_dimension(wcs, coverage_ids, type = c("temporal", "vertical")) emdn_get_coverage_dim_coefs( wcs, coverage_ids, type = c("temporal", "vertical") )
wcs |
A |
coverage_ids |
character vector of coverage IDs. |
type |
a coverage dimension type. One of |
emdn_get_coverage_summaries: returns a list of objects of class
<WCSCoverageSummary> for each coverage_id provided.
emdn_get_coverage_summaries_all: returns a list of objects of class
<WCSCoverageSummary> for each coverage avalable through the service.
emdn_get_coverage_ids returns a character vector of coverage ids.
emdn_get_coverage_dim_coefs returns a list containing a vector of
coefficients for each coverage requested.
a list containing a vector of coefficients for each coverage requested.
emdn_get_coverage_summaries(): Get summaries for specific coverages.
emdn_get_coverage_summaries_all(): Get summaries for all available
coverages from a service.
emdn_get_coverage_ids(): Get coverage IDs for all available
coverages from a service.
emdn_has_dimension(): check whether a coverage has a
temporal or vertical dimension.
emdn_get_coverage_dim_coefs(): Get temporal or
vertical coefficients for a coverage.
wcs <- emdn_init_wcs_client(service = "biology") cov_ids <- emdn_get_coverage_ids(wcs) cov_ids emdn_has_dimension(wcs, cov_ids, type = "temporal" ) emdn_has_dimension(wcs, cov_ids, type = "vertical" ) emdn_get_coverage_summaries(wcs, cov_ids[1:2]) emdn_get_coverage_summaries_all(wcs) emdn_get_coverage_dim_coefs(wcs, cov_ids[1:2], type = "temporal" )wcs <- emdn_init_wcs_client(service = "biology") cov_ids <- emdn_get_coverage_ids(wcs) cov_ids emdn_has_dimension(wcs, cov_ids, type = "temporal" ) emdn_has_dimension(wcs, cov_ids, type = "vertical" ) emdn_get_coverage_summaries(wcs, cov_ids[1:2]) emdn_get_coverage_summaries_all(wcs) emdn_get_coverage_dim_coefs(wcs, cov_ids[1:2], type = "temporal" )
Get EMODnet WCS service and available coverage information.
emdn_get_wcs_info( wcs = NULL, service = NULL, service_version = c("2.0.1", "2.1.0", "2.0.0", "1.1.1", "1.1.0"), logger = c("NONE", "INFO", "DEBUG") ) emdn_get_wcs_info_all(logger = c("NONE", "INFO", "DEBUG")) emdn_get_coverage_info( wcs = NULL, service = NULL, coverage_ids, service_version = c("2.0.1", "2.1.0", "2.0.0", "1.1.1", "1.1.0"), logger = c("NONE", "INFO", "DEBUG") )emdn_get_wcs_info( wcs = NULL, service = NULL, service_version = c("2.0.1", "2.1.0", "2.0.0", "1.1.1", "1.1.0"), logger = c("NONE", "INFO", "DEBUG") ) emdn_get_wcs_info_all(logger = c("NONE", "INFO", "DEBUG")) emdn_get_coverage_info( wcs = NULL, service = NULL, coverage_ids, service_version = c("2.0.1", "2.1.0", "2.0.0", "1.1.1", "1.1.0"), logger = c("NONE", "INFO", "DEBUG") )
wcs |
A |
service |
the EMODnet OGC WCS service name.
For available services, see |
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) |
coverage_ids |
character vector of coverage IDs. |
To minimize the number of requests sent to webservices,
these functions use memoise to cache results
inside the active R session.
To clear the cache, re-start R or run memoise::forget(emdn_get_wcs_info)/memoise::forget(emdn_get_coverage_info)
emdn_get_wcs_info & emdn_get_wcs_info return a list of service
level metadata, including a tibble containing coverage level metadata for each
coverage available from the service. emdn_get_coverage_info returns a list
containing a tibble of more detailed metadata for each coverage specified.
emdn_get_wcs_info / emdn_get_wcs_info_all
emdn_get_wcs_info and emdn_get_wcs_info_all return a list with the
following metadata:
data_source: the EMODnet source of data.
service_name: the EMODnet WCS service name.
service_url: the EMODnet WCS service URL.
service_title: the EMODnet WCS service title.
service_abstract: the EMODnet WCS service abstract.
service_access_constraits: any access constraints associated with the EMODnet WCS service.
service_fees: any access fees associated with the EMODnet WCS service.
service_type: the EMODnet WCS service type.
coverage_details: a tibble of details of each coverage available through EMODnet WCS service:
coverage_id: the coverage ID.
dim_n: the number of coverage dimensions
dim_names: the coverage dimension names, units (in brackets) and types.
extent: the coverage extent (xmin, ymin, xmax and ymax).
crs: the coverage CRS (Coordinate Reference System).
wgs84_bbox: the coverage extent (xmin, ymin, xmax and ymax)
in WGS84 (EPSG:4326) CRS coordinates.
temporal_extent: the coverage temporal extent (min - max), NA if coverage
contains no temporal dimension.
vertical_extent: the coverage vertical extent (min - max), NA if coverage
contains no vertical dimension.
subtype: the coverage subtype.
emdn_get_coverage_infoemdn_get_coverage_info returns a tibble with a row for each coverage
specified and columns with the following details:
data_source: the EMODnet source of data.
service_name: the EMODnet WCS service name.
service_url: the EMODnet WCS service URL.
coverage_ids: the coverage ID.
band_description: the description of the data contained each band of the coverage.
band_uom: the unit of measurement of the data contained each band of the coverage.
If all bands share the same unit of measurement, the single shared uom is shown.
constraint: the range of values of the data contained in each band of the coverage.
If all bands share the same constraint, the single shared constraint range is shown.
nil_value: the nil values of the data contained each band of the coverage.
If all bands share the same nil value, the single shared nil value is shown.
grid_size: the spatial size of the coverage grid (ncol x nrow).
resolution: the spatial resolution (pixel size) of the coverage grid
in the CRS units of measurement (size in the x dimension x size in the y dimension).
dim_n: the number of coverage dimensions
dim_names: the coverage dimension names, units (in brackets) and types.
extent: the coverage extent (xmin, ymin, xmax and ymax).
crs: the coverage CRS (Coordinate Reference System).
wgs84_bbox: the coverage extent (xmin, ymin, xmax and ymax)
in WGS84 (EPSG:4326) CRS coordinates.
temporal_extent: the coverage temporal extent (min - max), NA if coverage
contains no temporal dimension.
vertical_extent: the coverage vertical extent (min - max), NA if coverage
contains no vertical dimension.
subtype: the coverage subtype.
fn_seq_rule: the function describing the sequence rule which specifies
the relationship between the axes of data and coordinate system axes.
fn_start_point: the location of the origin of the data in the coordinate system.
fn_axis_order: the axis order and
direction of mapping of values onto the grid, beginning at the starting point. For
example, "+2 +1" indicates the value range is ordered from the bottom
left to the top right of the grid envelope - lowest to highest in the x-axis
direction first (+2), then lowest to highest in the y-axis direction (+1)
from the starting_point.
For additional details on WCS metadata, see the GDAL wiki section on WCS Basics and GDAL
emdn_get_wcs_info(): Get info on all coverages from am EMODnet WCS service.
emdn_get_wcs_info_all(): Get metadata on all services and all available
coverages from each service.
emdn_get_coverage_info(): Get metadata for specific coverages. Requires a
WCSClient R6 object as input.
# Get information from a wcs object. wcs <- emdn_init_wcs_client(service = "seabed_habitats") emdn_get_wcs_info(wcs) # Get detailed info for specific coverages from wcs object coverage_ids <- c( "emodnet_open_maplibrary__mediseh_cora", "emodnet_open_maplibrary__mediseh_posidonia" ) emdn_get_coverage_info( wcs = wcs, coverage_ids = coverage_ids )# Get information from a wcs object. wcs <- emdn_init_wcs_client(service = "seabed_habitats") emdn_get_wcs_info(wcs) # Get detailed info for specific coverages from wcs object coverage_ids <- c( "emodnet_open_maplibrary__mediseh_cora", "emodnet_open_maplibrary__mediseh_posidonia" ) emdn_get_coverage_info( wcs = wcs, coverage_ids = coverage_ids )
Initialise an EMODnet WCS client
emdn_init_wcs_client( service, service_version = c("2.0.1", "2.1.0", "2.0.0", "1.1.1", "1.1.0"), logger = c("NONE", "INFO", "DEBUG") )emdn_init_wcs_client( service, service_version = c("2.0.1", "2.1.0", "2.0.0", "1.1.1", "1.1.0"), logger = c("NONE", "INFO", "DEBUG") )
service |
the EMODnet OGC WCS service name.
For available services, see |
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) |
An ows4R::WCSClient R6 object with methods for interfacing an OGC
Web Coverage Service.
WCSClient in package ows4R.
(wcs <- emdn_init_wcs_client(service = "bathymetry"))(wcs <- emdn_init_wcs_client(service = "bathymetry"))
Available EMODnet Web Coverage Services
emdn_wcs()emdn_wcs()
Tibble of available EMODnet Web Coverage Services
emdn_wcs()emdn_wcs()