-
Notifications
You must be signed in to change notification settings - Fork 52
Description
In #132 I noticed the snippet:
with rasterio.Env(aws_unsigned = True,AWS_S3_ENDPOINT= 's3.af-south-1.amazonaws.com'):
stack = stackstac.stack(items)which doesn't currently work the way you'd expect (the environment settings you've just created will be ignored at compute time), but might be a pretty intuitive way to set extra GDAL options without mucking around with LayeredEnvs and the defaults.
We could even deprecate support for passing in a LayeredEnv directly, since it's far more complexity that most users would need, and erring on the side of fewer options is usually better.
There's some complexity around the fact that theoretically different types of Readers are supported, though in practice this is not at all true. Nonetheless, it might be worth extending the Reader protocol to expose either a DEFAULT_ENV: ClassVar[LayeredEnv] or a get_default_env() -> LayeredEnv classmethod.
Then ultimately, within items_to_dask, we'd pull the default env for the specified reader type, and merge it with any currently-set options (via rio.env.getenv()).