I have a private bucket in S3 with COGs in it.
Following the instructions here, it's actually very simple to do it manually.
However, this does indeed only work manually.
Trying to add a COG with the usual iface.addRasterLayer() dialogue works perfectly fine when my S3 bucket, or any other online host is public read, unfortunately, my bucket isn't and can't be public.
So the question is, How do I perform the manual add raster layer -> Protocol -> AWS S3 dialog programmatically with python?
Best Answer
You can add S3 using the following
You can get the uri provided to
rlayer
using below command from an existing s3 layer added through the GUIIt's also visible by going to the S3 layer "Properties" panel and in the tab "Information" you will see a line with
The syntax is borrowed from gdal vsis3 driver it seems e.g https://gdal.org/user/virtual_file_systems.html#vsis3-aws-s3-files