-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Read satellite data from AWS #104
Comments
@bcerripromethee If you clone the 0.21.0 branch, could you tell me if it fits your needs ? |
Alright, i'll test it ;) I just initiate the Reader with the path of the Element84 item (such as a random Sentinel-2 product) ? |
You can find some help here: https://github.com/sertit/eoreader/blob/0.21.0/docs/notebooks/aws.ipynb :) |
I feel awkward but I can't test your upgrade because you develop your tool on the products that needs AWS credentials. I actually use the element84 links 😅. For example, in the Element84's API, let's take this product : It has your AWS URL that EOReader is now able to read : And the Element84 URL that I usually take as an input in my processes : As far i know, the last one doesn't need any credentials or account. |
This should work: import tempenv
from sertit import s3
from eoreader.reader import Reader
from eoreader.bands import BLUE
with tempenv.TemporaryEnvironment({
"AWS_S3_ENDPOINT": "s3.us-west-2.amazonaws.com",
"AWS_SECRET_ACCESS_KEY": "",
"AWS_ACCESS_KEY_ID": "",
}):
with s3.temp_s3():
path = r"s3://sentinel-cogs/sentinel-s2-l2a-cogs/40/V/DR/2023/11/S2A_40VDR_20231114_0_L2A"
prod = Reader().open(path)
blue = prod.load([BLUE])[BLUE]
blue
|
I tried your methodology but it doesn't seems to work, i got this error : |
Sorry, I updated the code hereover. The only difference is to set |
You mean like this ? -> s2_path = r"s3://sentinel-s2-l2a/tiles/40/V/DR/2023/11/14/0/"
with tempenv.TemporaryEnvironment({"AWS_S3_ENDPOINT": "s3.eu-central-1.amazonaws.com",
"AWS_SECRET_ACCESS_KEY": "",
"AWS_ACCESS_KEY_ID": ""}):
with s3.temp_s3(requester_pays=True):
prod = Reader().open(s2_path)
print(prod) |
No, copy paste my piece of code 😉 And here you are trying to open a product from Sinergise and not E84, and for them you need credentials I think |
Even by copy-pasting your code i still get the message |
Ok, let's use only import os
from cloudpathlib import S3Client, AnyPath
import rasterio
from eoreader.reader import Reader
# Create your S3 path with cloudpathlib
aws_endpoint = "s3.us-west-2.amazonaws.com"
client = S3Client(endpoint_url=f"https://{aws_endpoint}")
client.set_as_default_client()
# Path
path = "s3://sentinel-cogs/sentinel-s2-l2a-cogs/40/V/DR/2023/11/S2A_40VDR_20231114_0_L2A"
# Create a rasterio env to enable reading on S3
with rasterio.Env(AWS_S3_ENDPOINT=aws_endpoint):
# Open your product
prod = Reader().open(path)
print(prod) |
I still get the same error message 😅 |
Maybe this: import os
from cloudpathlib import S3Client, AnyPath
import rasterio
from eoreader.reader import Reader
# Create your S3 path with cloudpathlib
aws_endpoint = "s3.us-west-2.amazonaws.com"
client = S3Client(endpoint_url=f"https://{aws_endpoint}", no_sign_request=True)
client.set_as_default_client()
# Path
path = "s3://sentinel-cogs/sentinel-s2-l2a-cogs/40/V/DR/2023/11/S2A_40VDR_20231114_0_L2A"
# Create a rasterio env to enable reading on S3
with rasterio.Env(AWS_S3_ENDPOINT=aws_endpoint, AWS_NO_SIGN_REQUEST="YES"):
# Open your product
prod = Reader().open(path)
print(prod) |
Your last solution worked !!!! 🍾🍾🍾🍾 |
Note that with with s3.temp_s3("s3.us-west-2.amazonaws.com", no_sign_request=True):
path = r"s3://sentinel-cogs/sentinel-s2-l2a-cogs/40/V/DR/2023/11/S2A_40VDR_20231114_0_L2A"
prod = Reader().open(path)
print(prod)
|
I'm closing this issue, but it still links to others (Umbra, STAC, MPC...) that are open. |
0.21.0 is up today :) |
EOReader is able to read products stored on the cloud.
The main issue is that the format of these products may be different from the one delivred elsewhere (i.e. no more SAFE format)
There is a community need for that, see #102
Sentinel-2
sentinel-2-l1c
- fromarn:aws:s3:::sentinel-s2-l1c
(Sinergise) - ✔️sentinel-2-l2a
- fromarn:aws:s3:::sentinel-cogs
(Element84) - ✔️sentinel-s2-l2a
- fromarn:aws:s3:::sentinel-s2-l2a
(Sinergise) - ✔️Sentinel-1
sentinel-1-grd
- fromarn:aws:s3:::sentinel-s1-l1c
(Sinergise) - ❌ WON'T DO for now as SNAP doesn't handle AWS-stored productsOther
landsat-c2-l1
andlandsat-c2-l2
](https://stacindex.org/catalogs/earth-search#/h1csNSDZ6exe2pHjNDjm3rmSbztdsZdWyF) - from
arn:aws:s3:::usgs-landsat/collection02/
(USGS) - ✔ ️Was already OK as their formatting are the same on cloud and on diskThen look at MPC data (delayed, as I need to register)
Don't forget to had documentation and a notebook about Cloud-stored products
The text was updated successfully, but these errors were encountered: