python通过gdal读取、写入存储栅格数据。栅格数据tif转化为array数组、array数组转化为栅格tif的函数方法:
首先必须引用引用gdal的模块包。
from osgeo import gdal, gdalconst
(1)python读取tif转化为数组的函数
def read_img(self, img_path):
"""读取遥感数据信息"""
dataset = gdal.Open(img_path, gdalconst.GA_ReadOnly)

本文介绍了如何使用Python的GDAL库读取和写入TIFF格式的栅格数据,包括从tif文件到array数组的转换,以及array数组转为栅格文件的函数实现。
最低0.47元/天 解锁文章
633

被折叠的 条评论
为什么被折叠?



