-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RandomGeoSampler does not work with flipped geotifs #1746
Comments
I'm able to reproduce this bug. @nilsleh this reminds me of a bug you had when working on rioxarray support. I wonder if we could use something like |
For rioxarray support I encountered |
Description
Certain geotifs have their axes flipped such as this one, which has the following transform flipping the direction of the x-axis:
Affine(-0.346241067933152, 0.2915401535597796, 366317.96341952495, 0.2915401535597782, 0.3462410679331555, 130406.04105973356)
.Depending on the transform, I believe this affects how random bounding boxes bounds should be ordered . For the example geotif above with x-axis flipped, this line maybe should be
bounds = (query.maxx, query.miny, query.minx, query.maxy)
instead ofbounds = (query.minx, query.miny, query.maxx, query.maxy)
. I have not tested it myself.RandomGeoSampler and RasterDataset do not check for this, resulting in a
Bounds and transform are inconsistent
errorSteps to reproduce
Version
0.5.1
The text was updated successfully, but these errors were encountered: