Closed RichardScottOZ closed 2 years ago
e.g. flipping data, bounds, affine elements, access to/updating etc.
The different value in the transform has to do with the coordinates loaded in from the original raster. Since rasters can be sliced and subsets extracted from the raster, the value of the transform is calculated from the ooordinates and not from the transform alone.
If you want the transform to be the same in the second raster, you also have to copy over the coordinates of the original raster.
Thanks Alan, figured it was something along those lines - stuck in a meeting before I could do some more tests.
Code Sample, a copy-pastable example if possible
Generally I fix this with rasterio, thought I would have a look here:-
Problem description
New transform is not quite right?.
Expected Output
presumably this is some affine handling would have to do differently - as updating rasterio metadata directly just assign a new transform tuple to the dictionary
Environment Information
python -c "import rioxarray; rioxarray.show_versions()"
rioxarray (0.9.1) deps: rasterio: 1.2.3 xarray: 0.18.2 GDAL: 3.2.1Installation method
Conda environment information (if you installed with conda):
Environment (
conda list
):