Can't write to s3


ian.liu88@...
 

When I try to create a file in s3 with `rasterio.open("s3://...", "w", ...)`, I get the following error:

rasterio.errors.RasterioIOError: Attempt to create new tiff file '/vsis3/my-bucket/test.tif' failed: Permission denied
I'm assuming this has to do with some kind of temporary file that GDal uses to write the file, but how do I configure this?

Thanks
Ian


Sean Gillies
 

Hi Ian,

GDAL doesn't support creating a GeoTIFF on S3 except via use of a temporary file. Configuration for that is explained in https://gdal.org/user/virtual_file_systems.html#vsis3-aws-s3-files. I tend not to use this and write to a temporary directory managed in Python and upload using boto3 instead.


On Tue, Dec 14, 2021 at 8:54 AM <ian.liu88@...> wrote:
When I try to create a file in s3 with `rasterio.open("s3://...", "w", ...)`, I get the following error:

rasterio.errors.RasterioIOError: Attempt to create new tiff file '/vsis3/my-bucket/test.tif' failed: Permission denied
I'm assuming this has to do with some kind of temporary file that GDal uses to write the file, but how do I configure this?

Thanks
Ian



--
Sean Gillies


ian.liu88@...
 

Sorry for the delay, I've missed the reply.

I've managed to create the s3 file by writing to a MemoryFile! Thanks!