faninsar.datasets.GeoDataset#

class faninsar.datasets.GeoDataset[source]#

Bases: ABC

Abstract base class for all faninsar datasets.

This class is used to represent a geospatial dataset and provides methods to index the dataset and retrieve information about the dataset, such as CRS, resolution, data type, no data value, and a bounds.

__init__() None[source]#

Initialize a new GeoDataset instance.

Methods

__init__()

Initialize a new GeoDataset instance.

Attributes

bounds

Bounds of the overall dataset.

crs

Coordinate reference system (CRS) of the dataset.

dtype

Data type of the dataset.

nodata

No data value of the dataset.

res

Return the resolution of the dataset.

roi

Return the region of interest of the dataset.

same_crs

Whether all files in the dataset have the same CRS with the desired CRS.

shape

Shape of the dataset.

valid

Return a boolean array indicating which files are valid.

property bounds: BoundingBox#

Bounds of the overall dataset.

It is the union of all the files in the dataset.

Returns:

bounds – (minx, right, bottom, top) of the dataset

Return type:

BoundingBox object

property crs: CRS | None#

Coordinate reference system (CRS) of the dataset.

Return type:

The coordinate reference system (CRS).

property dtype: dtype | None#

Data type of the dataset.

Returns:

dtype – data type of the dataset

Return type:

numpy.dtype object or None

property nodata: float | None#

No data value of the dataset.

Returns:

nodata – no data value of the dataset

Return type:

float or int

property res: tuple[float, float]#

Return the resolution of the dataset.

Returns:

res – resolution of the dataset in x and y directions.

Return type:

tuple of floats

property roi: BoundingBox | None#

Return the region of interest of the dataset.

Returns:

roi – region of interest of the dataset. If None, the bounds of entire dataset will be used.

Return type:

BoundingBox object

property same_crs: bool#

Whether all files in the dataset have the same CRS with the desired CRS.

property shape: tuple[int, int]#

Shape of the dataset.

Returns:

shape – shape of the dataset in (height, width) format

Return type:

tuple of ints

property valid: ndarray#

Return a boolean array indicating which files are valid.

Returns:

valid – boolean array indicating which files are valid. True means the file is valid and can be read by rasterio, False means the file is invalid.

Return type:

numpy.ndarray