We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Directly reading from object storage with rasterio is a very nice thing and people have gotten this to work with the following code (from the forums):
rasterio
import boto3 import rasterio from rasterio.session import AWSSession import numpy as np BUCKET = 'DIAS' KEY = 'Sentinel-2/MSI/L2A/2018/08/09/S2A_MSIL2A_20180809T105031_N0208_R051_T31TCG_20180809T141746.SAFE/GRANULE/L2A_T31TCG_A016350_20180809T105627/IMG_DATA/R10m/T31TCG_20180809T105031_B03_10m.jp2' access_key = 'anystring' secret_key = 'anystring' session = boto3.Session(aws_access_key_id=access_key, aws_secret_access_key=secret_key) with rasterio.Env(AWSSession(session), AWS_S3_ENDPOINT='data.cloudferro.com', AWS_HTTPS='NO', AWS_VIRTUAL_HOSTING='FALSE') as env: print(env.options) with rasterio.open('/vsis3/{}/{}'.format(BUCKET, KEY), 'r') as ds: array = ds.read(1) print(array.shape)
Since everything here is static except for the key, we could consider adding a little convenience context manager, that allows you to do like
with eodata_rasterio_open(key) as ds: pass
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Directly reading from object storage with
rasterio
is a very nice thing and people have gotten this to work with the following code (from the forums):Since everything here is static except for the key, we could consider adding a little convenience context manager, that allows you to do like
The text was updated successfully, but these errors were encountered: