Accessing Data#

When working with Earth observation data, it must be read from the relevant file containing it and then stored in the computer’s memory.

The Open Data Cube (ODC) ecosystem represents Earth observation data as spatio-temporal arrays: the data are contextualised by spatial information indicating the location of pixels on Earth, and temporal information indicating when the observation was made.

The ODC ecosystem leverages the Xarray Python package for implementing spatio-temporal arrays. An example Xarray from the ODC is shown in Fig. 4.

../_images/odc-xarray.png

Fig. 4 An Xarray is a labelled multi-dimensional array structure for Python. When used by the Open Data Cube, it contains information on the dimensions, variables, values, coordinates, and the coordinate reference system, making it a spatio-temporal array.#

Depending on how the data is managed, there are different ODC ecosystem packages that can be used to open Earth observation data as a spatio-temporal Xarray:

  • datacube-core: accessing data from an existing Open Data Cube deployment

  • odc-stac: accessing data from an existing STAC API

  • rioxarray: accessing data from data files

rioxarray is not managed by the maintainers of the ODC Ecosystem, but has been inspired by the ODC ecosystem. It provides a method to create labelled Xarrays similar to those produced within the ODC ecosystem.

The flowchart in Fig. 5 may help you understand the best package for accessing data depending on how the data are managed.

../_images/stac-or-core.png

Fig. 5 There are three packages that can be used to access data as a labelled spatio-temporal Xarray depending on how the data are managed: datacube-core, odc-stac, and rioxarray.#

To read more about each package, see ODC Software Packages. To understand if there is an existing ODC deployment that covers your area of interest, see Existing Deployments.