我将栅格存储在 Amazon S3 存储桶中,并希望使用我的 Django docker 容器中安装的栅格库打开特定对象。
AWS_ACCESS_KEY_ID 和 AWS_ACCESS_KEY_ID 包含在 docker-compose.yml 环境变量中。
在 docker 容器内并尝试:
$ python manage.py shell
$ import rasterio
$ with rasterio.open(url_to_s3_object) as file:
$ ....print(file)
我收到错误:
Traceback (most recent call last):
File "rasterio/_base.pyx", line 72, in rasterio._base.DatasetReader.start (rasterio/_base.c:2847)
File "rasterio/_base.pyx", line 74, in rasterio._base.DatasetReader.start (rasterio/_base.c:2799)
File "rasterio/_err.pyx", line 196, in rasterio._err.CPLErrors.check (rasterio/_err.c:1773)
rasterio._err.CPLE_OpenFailed: {URL TO S3 OBJECT} does not exist in the file system, and is not recognised as a supported dataset name.
解决方案是什么?
在本地机器上一切正常。