Open RichardScottOZ opened 3 years ago
I think you need to pass the enum value from rasterio's Resampling enum
I am guessing the integer-resampling mapping is the same as rasterio. See the rasterio docs here: https://rasterio.readthedocs.io/en/latest/api/rasterio.enums.html#rasterio.enums.Resampling
I was on my phone before but yes, it should be a resampling enum https://github.com/gjoseph92/stackstac/blob/b652a07f9b2ae27235aea4db4ef0f1f594fd8941/stackstac/stack.py#L29
Yes, my guess too when testing. We should put this in an example so people see it obviously. Or be fancy and the common text terms could map back via a dictionary?
Or be fancy and the common text terms could map back via a dictionary?
This seems worthwhile. Quite easy to add something like
if isinstance(resampling, str):
try:
resampling = Resampling[resampling]
except KeyError:
raise ValueError(...) from None
Just curious, what's the point of raising the exception from None
there? I would've assumed that would be identical to a bare raise ValueError
@kylebarron the from None
just will give a shorter, cleaner traceback, eliminating the During handling of the above exception, another exception occurred
message you'd otherwise see.
https://stefan.sofa-rockers.org/2020/10/28/raise-from/ https://stackoverflow.com/a/24752607
I'd love to take this on as a first issue with stackstac!
@szwiep sorry I missed your comment, please feel free to take this on, that would be much appreciated!
Hi all, finally put aside the time to get around to this! One question, how can I install from source/test my changes? I can't find documentation on this, so if you could point me in the right direction that'd be appreciated.
Without thinking I put resampling="bilinear" and got an error when I called .compute()
so I presume you need to pass the integer from the enum? e.g. 1 in this case? Or I am not quite clear on what this keyword is expecting?