from osgeo import gdal
# 打开tif影像
image_path = "F:\\你的文件路径\\your_tif_name.tif"
your_ds = gdal.Open(image_path)
if your_ds is None:
print("无法打开影像!")
exit()
else:
print("tif影像可以被成功打开!")
# 关闭数据集
your_ds = None
03-27
04-18
4414
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
02-07
2万+
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
12-16
1062
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)