Open iamtekson opened 10 months ago
Here are a few steps you can take to troubleshoot this issue:
Check Coordinate Systems: Verify that all the datasets or images involved in the mosaic operation share the same coordinate system. Even a slight difference could cause inconsistency.
Confirm Bounds: Ensure that the bounding coordinates (left, bottom, right, top) are correctly defined and consistent with the coordinate system used.
Transformation Information: Double-check the transformation or georeferencing information associated with your raster datasets. Ensure they are accurate and consistent.
Data Integrity: Check the integrity of your raster data files. Sometimes corrupt or incomplete files can cause issues with their transformation information.
This might be an issue from rasterio library: https://github.com/rasterio/rasterio/issues/2976
The workaround for this issue would be manually remove below if
condition in rasterio.windows.py
file,
if (right - left) / transform.a < 0:
raise WindowError("Bounds and transform are inconsistent")
if (bottom - top) / transform.e < 0:
raise WindowError("Bounds and transform are inconsistent")
By doing so many tests, I found that if the raster have float64
dtype, it create the problem. When I check, I found that, in float64
dtype raster, generate_tiles
start creating the tiles from bottom left of the raster moving in the top and right direction while for other dtype raster, it start creating the tiles from top left moving in the bottom and right direction. It is still kind of strange.