Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion aeronet_raster/aeronet_raster/__version__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VERSION = (0, 2, 5)
VERSION = (0, 2, 6)

__version__ = '.'.join(map(str, VERSION))
6 changes: 1 addition & 5 deletions aeronet_raster/aeronet_raster/band/band.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,15 +303,11 @@ def reproject(self, dst_crs: str, dst_res: tuple = None,
else:
dst_crs = dst_crs if isinstance(dst_crs, CRS) else CRS.from_user_input(dst_crs)

# Old rasterio compatibility: a separate check for validity
if not dst_crs.is_valid:
raise rasterio.errors.CRSError('Invalid CRS {} given'.format(dst_crs))

# get temporary filepath if such is not provided
tmp_file = False if fp is not None else True
if fp is None:
fp = '{tmp}/reprojected_{crs}/{directory}/{name}.tif'.format(
tmp=TMP_DIR, crs=dst_crs, directory=random_name(), name=self.name)
tmp=TMP_DIR, crs=str(dst_crs).replace(':', ''), directory=random_name(), name=self.name)
os.makedirs(os.path.dirname(fp), exist_ok=True)

# calculate params of new reprojected Band
Expand Down
8 changes: 0 additions & 8 deletions aeronet_raster/aeronet_raster/band/bandsample.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ def __init__(self, name: str, raster: np.ndarray, crs: Union[str, CRS],
self._transform = Affine(*transform) if not isinstance(transform, Affine) else transform
self._crs = CRS.from_user_input(crs) if not isinstance(crs, CRS) else crs

# Old rasterio compatibility: a separate check for validity
if not self._crs.is_valid:
raise rasterio.errors.CRSError('Invalid CRS {} given'.format(crs))

def __eq__(self, other) -> bool:
res = np.allclose(self.numpy(), other.numpy())
res = res and (self.crs == other.crs)
Expand Down Expand Up @@ -208,10 +204,6 @@ def reproject(self, dst_crs: Union[str, CRS], interpolation: str = 'nearest') ->
else:
dst_crs = dst_crs if isinstance(dst_crs, CRS) else CRS.from_user_input(dst_crs)

# Old rasterio compatibility: a separate check for validity
if not dst_crs.is_valid:
raise rasterio.errors.CRSError('Invalid CRS {} given'.format(dst_crs))

dst_transform, dst_width, dst_height = calculate_default_transform(
self.crs, dst_crs, self.width, self.height, *self.bounds)

Expand Down
2 changes: 1 addition & 1 deletion aeronet_raster/aeronet_raster/collectionprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ def __init__(self,
input_channels: List[str],
output_labels: List[str],
processing_fn: Callable,
sample_size: Tuple[int] = (1024, 1024),
sample_size: Tuple[int, int] = (1024, 1024),
bound: int = 256,
src_nodata=0,
nodata=None, dst_nodata=0,
Expand Down