Skip to content

Raster data handling

Alexey Trekin edited this page Jan 24, 2020 · 1 revision

datasets.raster provides an adapter to the raster data placed at the HDD.

The Band object is a wrapper over a rasterio.DatasetReader/rasterio.DatasetWriter object, and is in general a file handle with the image metadata. It refers to a geotiff file containing a single band (a spectral band, a derived product in the raster form, or a mask).

The Band identifies as the path of the file which it is bound to.

The Bands can be reprojected to another CRS, or resampled to another GSD. As the Band represents a file in the filesystem, in case of any change, it can write to the same file or create a new file. By default, if the file path is not specified, all the transformations as well as creation of new Bands trigger the creation of a new temporary file in the default temp directory. On destruction of the Band object the file is deleted, however there is a known issue than in some cases the deletion can be missed, and then the new created Bands are corrupted. In case of any important data it is better to create the Bands in the determined filepaths.

The BandCollection is a List of the Band objects, associated with the same place. They must have the same georeferencing (CRS and transform), and the same raster dimensions. BandCollection can be transformed as well as the single Bands.

Clone this wiki locally