如下所示:
from osgeo import gdal
import numpy as np
def read_tiff(inpath):
ds=gdal.Open(inpath)
row=ds.RasterXSize
col=ds.RasterYSize
band=ds.RasterCount
geoTransform=ds.GetTransform()
proj=ds.GetTransform()
data=np.zeros([row,col,band])
for i in range(band):
dt=ds.GetRasterBand(1)
1