Closed MWieland closed 4 years ago
Please be careful with the order of parameters to keep compatibility. I am also not sure how useful this is, why would you read in the whole image and then only use a subset of it? Would it not be better to read in a subset from the start?
To work on a subset of an image can be very useful and efficient. I agree with you that reading in a subset from the start would be the better option. @fwfichtner Can we add a subset option (like windowed reading) to Image initialization?
It is quite simple and already there if you want. You can read in the subset like in this example and the initialize Image
with the windowed dataset
.
Thanks for the example. It seems to work with image coordinates though. Wouldnt it be desirable to have this work with real world coordinates? We could provide this as a convenience call option in ukis-pysat, which could proof an added value compared to plain rasterio windowed reading. Curious about your opinion.
This you can solve using rasterio.windows.from_bounds
. I guess what I'm saying is that we would just put something inside which already exists outside and is more accessible there.
Alright in this case I agree. Did not know about this rasterio method. Thanks for clarifying. Closing this issue.
It would be great to have an option to limit warping to a subset of the image in order to speed up computation. Currently, warping is always performed on the whole Image. An simple solution could be to add an optional "bounds" parameter that passes the bounding box coordinates in source crs coordinates to the method. A simple implementation could look as follows (NOTE: this example already considers #60 and #62 ):