GeoTIFF utilities¶
async_geotiff.utils ¶
Public utilities for async-geotiff.
reshape_as_image ¶
reshape_as_image(arr: MaskedArray) -> MaskedArray
reshape_as_image(arr: NDArray[T] | MaskedArray) -> NDArray[T] | MaskedArray
Return the source array reshaped into standard image axis ordering.
Libraries like async-geotiff and rasterio return arrays in (bands, rows, columns)
order, while image processing and visualization software like Lonboard require
(rows, columns, bands) order.
This function performs this reshaping by swapping the axes order from (bands, rows, columns) to (rows, columns, bands).
For more information, read the rasterio documentation on interoperability.
Parameters:
-
arr(NDArray[T] | MaskedArray) –array-like of shape (bands, rows, columns)