-
Notifications
You must be signed in to change notification settings - Fork 106
Replies: 2 comments · 11 replies
-
👋 it should work natively with S3 URL (as long as you have credential set in your environment) https://github.com/cogeotiff/rio-tiler/blob/main/rio_tiler/io/stac.py#L54-L88 let me have a look |
Beta Was this translation helpful? Give feedback.
All reactions
-
I'm using a shared credentials file and a default profile. Here is my AWS config:
Fwiw, with this configuration I am able to successfully access to the STAC Item's asset href using
|
Beta Was this translation helpful? Give feedback.
All reactions
-
@vincentsarago given that it is working fine for you, could you check how your execution path and/or variables differ from what I am seeing in the traceback? Below I have included the values of the local variables at each level of the traceback. Environment variables
locals() @ <attrs generated init rio_tiler.io.stac.STACReader>:28
locals() @ rio_tiler/io/stac.py:250
locals() @ cachetools/__init__.py:737
locals() @ rio_tiler/io/stac.py:116
locals() @ rio_tiler/io/stac.py:91
locals() @ botocore/client.py:553
locals() @ botocore/client.py:1009
|
Beta Was this translation helpful? Give feedback.
All reactions
-
The boto3 docs say that the
I find that if I do not pass the endpoint_url (i.e. Is there a reason that rio-tiler constructs and passes a value for |
Beta Was this translation helpful? Give feedback.
All reactions
-
ok so I think we should do something like # AWS_S3_ENDPOINT and AWS_HTTPS are GDAL config options of vsis3 driver
# https://gdal.org/user/virtual_file_systems.html#vsis3-aws-s3-files
endpoint_url = os.environ.get("AWS_S3_ENDPOINT", None)
if endpoint_url:
use_https = os.environ.get("AWS_HTTPS", "YES")
if use_https.upper() in ["YES", "TRUE", "ON"]:
endpoint_url = "https://" + endpoint_url
else:
endpoint_url = "http://" + endpoint_url
client = session.client("s3", endpoint_url=endpoint_url) |
Beta Was this translation helpful? Give feedback.
All reactions
-
Confirming that your suggested change will likely work for my use case.
results in
|
Beta Was this translation helpful? Give feedback.
All reactions
-
Can rio-tiler make use of a rasterio AWS session? Something like:
|
Beta Was this translation helpful? Give feedback.
All reactions
-
you can do, but I still don't get why the snippet doesn't work :-( client = rasterio_aws_session.client("s3")
with rio_tiler.io.STACReader(s3_uri, fetch_option={"client": client}) as stac:
pass |
Beta Was this translation helpful? Give feedback.
-
I am trying to adapt the STACReader example code to work with a public STAC Item file stored on AWS S3 using the s3 URI scheme.
Using the Object URL works:
However, using the s3 URI fails:
with the error
stack trace
To get
STACReader
to recognize s3 URIs, do you need to setup a custom StacIO class?Beta Was this translation helpful? Give feedback.
All reactions