Save file with driver COG#702
Conversation
|
I meant that if it's None, then we have the default driver, sorry. |
|
Maybe driver and compression can be pass as kwargs ? |
|
Thanks for the comment @adebardo . However, the function |
|
Thanks! My thoughts on this join this previous discussion: #650 (comment). This would solve the above problem by allowing to pass all arguments linked to I/O separately (which is the norm, whether in Xarray, Pandas or other): dem1 = DEM(fn1)
dem2 = DEM(fn2)
# Case 1: In-memory
dem_coreg = dem1.coregister_3d(dem2)
dem_coreg.save(outfile, driver=, compression=)
# Case 2: Out-of-memory Multiprocessing
mp_config = MultiprocConfig(outfile, driver=, compression=)
dem_coreg = dem1.coregister_3d(dem2, mp_config=mp_config)
# Case 3: Out-of-memory Dask
dem_coreg = dem1.coregister_3d(dem2)
writer = dem_coreg.to_raster(outfile, encoding={driver=, compression=}, compute=False)
writer.compute()I think having a one-liner convenience function that can take all these arguments at once would belong better in a CLI where we cannot chain I/O operations easily. |
|
In the meantime, while we keep |
|
Thanks for your feedback, @rhugonnet . |
This PR adds the option to save file with driver
COGinxdem/coreg/workflows.py.Resolves #691.