tophu.RasterBand

class tophu.RasterBand(filepath, width=None, height=None, dtype=None, *, band=None, driver=None, crs=None, transform=None, **options)

A single raster band in a GDAL-compatible dataset containing one or more bands.

Notes

This class does not store an open file object. Instead, the file is opened on-demand for reading or writing and closed immediately after each read/write operation. This allows multiple spawned processes to write to the file in coordination (as long as a suitable mutex is used to guard file access.)

Attributes
ndim

int : Number of array dimensions.

Methods

RasterBand.__init__(filepath[, width, ...])

RasterBand.__getitem__(key, /)

Read a block of data.

Attributes

RasterBand.ndim

Number of array dimensions.

RasterBand.filepath

The file path.

RasterBand.band

Band index (1-based).

RasterBand.driver

Raster format driver name.

RasterBand.crs

The dataset's coordinate reference system.

RasterBand.transform

The dataset's georeferencing transformation matrix.

RasterBand.shape

Tuple of array dimensions.

RasterBand.dtype

Data-type of the array's elements.