Closed alronlam closed 2 years ago
@tm-jc-nacpil is my interpretation right that this function is actually applicable not only to COGs, but any rasterio dataset?
@alronlam Yup! Any rasterio dataset We did this approach (pass a dataset instead of a path to open a new dataset) kasi we didn't want to open a new dataset everytime we queried the window, because the opening step is a bottleneck especially if you're opening COGs repeatedly
So usually the pattern when using it is
with rio.open(<path to raster>) as dst:
query_window(dset, <output_path>, <grid bounds to clip>)
@tm-jc-nacpil Ok got it. So to confirm, what value/convenience does this provide over rasterio's window function (this is what actually gets the subset right)? Is it the creation of the subset's tiff file, which involves setting the right metadata?
This is from @tm-jc-nacpil :
Input: RasterIO Dataset Output: Cropped window saved to a new file
Reference Implementation: