我需要在 python 中打开 .jp2 光栅文件。
我按照这些说明安装了 GDAL 。
使用命令行运行gdalinfo --formats列出JP2OpenJPEG驱动程序。gdalinfo filename.jp2返回预期输出。
但在Python中
import gdal
data=gdal.Open('filename.jp2')
不返回任何内容(.tiff 有效)。
安装了另外 2 个使用 GDAL 的应用程序,因此我假设 python 使用了错误的 GDAL 安装。
我在 R 中遇到同样的问题,但我可以指出正确的安装
library(gdalUtils)
gdal_chooseInstallation('JP2OpenJPEG')
有没有办法将 python 指向正确的安装或添加 jp2 的驱动程序?
Windows 10
Python 2.7
GDAL 2.1.0