![](/img/trans.png)
[英]How to access XML file from Azure Data Lake Gen2 and transform it into data-frame in Azure Databricks?
[英]Read Azure Datalake Gen2 images from Azure Databricks
我正在处理存储在 Azure Data Lake Gen2 中的.tif
文件。 要打开使用该文件rasterio
从Azure的Databricks。
例子:
当从数据湖读取图像文件时,作为spark.read.format("image").load(filepath)
工作正常。
但试图打开相同
with rasterio.open(filepath) as src:
print(src.profile)
得到错误:
RasterioIOError: wasbs://xxxxx.blob.core.windows.net/xxxx_2016/xxxx_2016.tif: No such file or directory
任何线索做错了什么?
更新:
正如 Axel R 所建议的,在 Databricks 文件系统上安装了文件,但仍然遇到同样的问题,无法从 rasterio 打开文件,但可以读取为 df。
还尝试通过为 Datalake 中的文件创建共享访问签名并尝试通过 URI 访问文件。 现在收到错误以下错误:
CURL error: error setting certificate verify locations: CAfile: /etc/pki/tls/certs/ca-bundle.crt CApath: none
为了进一步测试尝试从网络打开一个相同的文件@
filepath = 'http://landsat-pds.s3.amazonaws.com/c1/L8/042/034/LC08_L1TP_042034_20170616_20170629_01_T1/LC08_L1TP_042034_20170616_20170629_01_T1_B4.TIF'
很好用。
我相信这是因为 rasterio 使用的是本地 API,并且只能从以 /dbfs/ 开头的路径读取。
您是否可以挂载 blob 存储? 这将允许您使用 rasterio 访问它,路径以 /dbfs/mnt/ 开头
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.