-
Notifications
You must be signed in to change notification settings - Fork 24
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
Access to image native dimensions #128
Comments
Hello, Your feature would be nice to have! If it's the case, you can query the band path with Something like this should work: path = "S2A_MSIL1C_20220130T073141_N0400_R049_T36KYG_20220130T092334.SAFE"
prod = Reader().open(path)
band_paths = prod.get_band_paths([RED, GREEN, BLUE])
with rasterio.open(band_paths[RED]) as ds:
red_shape = ds.shape
|
In my case, I don't need to orthorectify or reproject the product. I want to chunk it in 256x256, let say for a custom algorithm, to reduce memory usage or for parallization. However, I feel that improving Dask support would do just that: To answer your proposition of using rasterio, I was not sure it would work in all cases (zipped archives, netcdf, ...) but it seems that EOREADER always provide a direct posix path to the uncompressed image file. Am I right ? |
Beware, Dask support is still on an early stage, I cannot guarantee that load will do everything lazily. 😅 The issue is that EOReader will always want to work with UTM bands, so everything has been coded to give access to these bands. If they already exists, then no problem everything will be seamless. But if they don't exist, their computation is done no matter what, and this takes time. This will depend on your type of input data. The path returned by |
Thanks for your explanations. So if I understand correctly:
|
Sorry to bother, the FAQ already answers these points |
No problem!
|
Is your feature request related to a problem? Please describe.
When loading a band, I can't find a way to get the native full-size dimensions before actually loading it.
Describe the solution you'd like
I would like an API to query the band dimensions, so that I can use a tiling strategy to load the data piece by piece (using the rasterio Window object for instance).
Describe alternatives you've considered
Maybe a function like
Product.get_band_shape(resolution: float = None)
so the user can estimate the buffer size he will get, depending on the resolution chosen. Ifresolution = None
, use the native resolution.Additional context
The text was updated successfully, but these errors were encountered: