[Fix] Band_list bugfix

own
Yizhou Chen 3 years ago committed by GitHub
parent e4448ba48f
commit f708655747
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      tools/utils/raster.py

@ -64,6 +64,7 @@ class Raster:
band_list (Union[List[int], Tuple[int], None]):
band list (start with 1) or None (all of bands).
"""
self.bands = self._src_data.RasterCount
if band_list is not None:
if len(band_list) > self.bands:
raise ValueError(
@ -100,7 +101,6 @@ class Raster:
def _getInfo(self) -> None:
if self._src_data is not None:
self.bands = self._src_data.RasterCount
self.width = self._src_data.RasterXSize
self.height = self._src_data.RasterYSize
self.geot = self._src_data.GetGeoTransform()
@ -134,7 +134,7 @@ class Raster:
ima = np.stack(band_array, axis=0)
return ima
def _getAarray(
def _getArray(
self,
window: Union[None, List[int], Tuple[int]]=None) -> np.ndarray:
if window is not None:

Loading…
Cancel
Save