GeoEco.Datasets.ArcGIS.ArcGISRaster.GetRasterBand
- classmethod ArcGISRaster.GetRasterBand(path, band=1, decompressedFileToReturn=None, cacheDirectory=None)
Opens an ArcGIS raster and returns an
ArcGISRasterBandfor the specified band.This is a convenience function that is equivalent to:
from GeoEco.Datasets.ArcGIS import ArcGISRaster with ArcGISRaster(path, decompressedFileToReturn=decompressedFileToReturn, cacheDirectory=cacheDirectory) as dataset: grids = dataset.QueryDatasets('Band = %i' % band, reportProgress=False) if len(grids) <= 0: raise ValueError(_('Cannot retrieve band %(band)i from %(dn)s. The band does not exist.') % {'band': band, 'dn': dataset.DisplayName}) arcgisRasterBand = grids[0] # Now do something with the arcgisRasterBand object...
- Parameters:
path (
str) – ArcGIS catalog path to the raster. Minimum length꞉ 1. Must exist.band (
int, optional) – The band to get. Minimum value꞉ 1.decompressedFileToReturn (
str, optional) –glob()expression that identifies the extracted file to open when the path points to an archive (e.g. a .zip or .tar file). Minimum length꞉ 1.cacheDirectory (
str, optional) –Directory to cache a copy of the downloaded or decompressed file.
If provided, this directory will be checked for the file prior to download or decompression. If the file is found, the download and decompression will be skipped. Thus, when performing repetitive processing with remote or compressed datasets, you can speed up processing considerably by providing a cache directory.
Minimum length꞉ 1.
- Returns:
ArcGISRasterBandinstance.- Return type: