Questions tagged «rasterio»

1
使用rasterio获取单个点的像素值
要使用rasterio在栅格中的某个点上获得单个像素值,请参见此处的示例:https : //github.com/mapbox/rasterio/pull/275 但是,在rasterio(而不是cli)中是否有直接API可用于在栅格中的单个点提取值? -编辑 with rasterio.drivers(): # Read raster bands directly to Numpy arrays. # with rasterio.open('C:\\Users\\rit\\38ERP.tif') as src: x = (src.bounds.left + src.bounds.right) / 2.0 y = (src.bounds.bottom + src.bounds.top) / 2.0 vals = src.sample((x, y)) for val in vals: print list(val)
14 python  numpy  rasterio 

1
使用rasterio读取S3 Sentinel-2图像文件
使用rasterio打开Sentinel-2 AWS .jp2图像文件(当前由Sinergise托管,可以在此处找到)后,我当前遇到“访问被拒绝”错误。 我的代码如下所示: import rasterio access_key = '*****************' secret_access_key = '***********************' region_name = 'eu-central-1' Session = rasterio.env.Env(aws_access_key_id=access_key, aws_secret_access_key=secret_access_key, region_name=region_name) url = 's3://sentinel-pds/tiles/10/S/DG/2015/12/7/0/B01.jp2' with Session: with rasterio.open(url) as dataset: print dataset 响应为: --------------------------------------------------------------------------- CPLE_AWSAccessDenied Traceback (most recent call last) <ipython-input-1-4f6da7274649> in <module>() 12 13 with Session: ---> 14 with rasterio.open(url) …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.