【发布时间】:2017-02-02 07:06:48
【问题描述】:
我正在尝试运行以下代码:
from osgeo import gdal
import sys
# This allows GDAL to throw Python exceptions
src_ds = gdal.Open("fused.tif")
src_ds.show()
但我收到以下错误:
Traceback (most recent call last):
File ".../gdalopen1.py", line 5, in module src_ds.show()
AttributeError: 'Dataset' object has no attribute 'show'
为什么会这样?
【问题讨论】:
-
这个对象似乎不存在“show”。在this 页面上,他们打开
*.tif图像,然后打开print gtif.GetMetadata()。这对你有用吗? -
您希望
.show()方法做什么?绘制栅格?为什么?您在哪里看到此方法的文档?.Open方法已打开光栅 - 成功。现在你想用它做什么? -
我们需要读取图像并在python中显示融合的geotiff图像。你能解释一下如何读取数组中的图像