Closed DahnJ closed 4 months ago
However, this is only the case of the linear part of the transformation – the offset/translation part is recalculated using rio._unordered_bounds() (source) which takes them from rio._internal_bounds() (source)
With xarray
you can slice/select subsets of data and have the same GeoTransform
stored in the metadata. The GeoTransform
would be incorrect in this scenario. Due to this, the resolution
component of the GeoTransform
is the only part that can be trusted.
Thanks for the explanation @snowman2, this makes complete sense.
Code Sample, a copy-pastable example if possible
Problem description
I would expect
rio.transform(recalc=False)
to return the exact transform stored usingwrite_transform
.However, this is only the case of the linear part of the transformation – the offset/translation part is recalculated using
rio._unordered_bounds()
(source) which takes them fromrio._internal_bounds()
(source)This may not be a bug, but it's a surprising behaviour I decided to note.
Expected Output
Environment Information
Installation method
Conda