odcr is an R package that serves as a simple interface to the Open Data Cube. As such, it facilitates interaction with an Open Data Cube instance to access, query, list and load data as a native xarray-equivalent class. It implements basic methods to subset/index, plot and execute basic arithmetic operations on data and convert to native spatial raster classes such as stars or raster.
- basic database connection (see
?odcr::database) -
datacubecoreDatacubeclass methods (see?odcr::datacube) -
datacubecore data discovery methods (see?odcr::datacube -
datacubecore data loading methods (see?odcr::datacube -
datacubecore grid processing methods -
datacubecore indexing methods - support for native proxy class for streaming values directly (such as
stars_proxy) -
xarrayxarray.core.dataarray.DataArrayclass and formal S3 definition -
xarrayxarray.core.dataset.Datasetclass and formal S3 definition -
xarraynative S3 methods for retrieving dimensions (see?odcr::dim) -
xarraynative S3 methods for indexing by arbitrary number of dimensions (see?odcr::Extract) -
xarraynative S3 methods for indexing by variable (see?odcr::Extract) -
xarraynative S3 methods for indexing by time strings (see?odcr::Extract) -
xarraynative S3 methods for assigning/replacing variables (see?odcr::Extract) -
xarraynative S3 methods for arithmetic operators (see?odcr::Arithmetic) -
xarraynative S3 methods for coercing to native spatial classesraster*andstars(see?odcr::as) -
xarraynative S3 methods for plotting (see?odcr::plot) - unit tests
- configuration (see
?odcr::config) - ...
odcr requires the Open Data Cube Python library datacube which needs to be installed as part of a working Open Data Cube installation. See odcbox, if you want to install and set-up an Open Data Cube container environment that meets all odcr system requirements "out-of-the-box".
In case you have multiple Python installations or (virtual) environments installed, use odcr::config to make sure that odcr is using the correct Python installation and environment so that it can load and interact with the datacube library.
odcr is in active development and thus breaking changes to its interface need to be expected. Install the latest development version of odcr from GitHub:
devtools::install_github("eo2cube/odcr")In case you want to build the package manually, clone the repository and cd to its main directory. odcr uses roxygen2 for documentation. Make sure, devtools, roxygen2 and pkgdown are installed. Run:
source("build.R")See the vignette Using odcr for a full introduction on how to use odcr with Sentinel-2 example data. Documentation and examples are available at https://eo2cube.github.io/odcr/.
See the package index.