|
|
|
@ -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: |
|
|
|
|