我想找到DEM(数字高程模型)栅格的垂直(z)分辨率。
使用gdal,我可以轻松找到x和y分辨率以及像素宽度:
dem = gdal.Open('DEMraster50.tif') #DEM is a rectangular tif
ncol = dem.RasterXSize #number of columns (aka number of cells along x axis)
nrow = dem.RasterYSize #number of rows (aka number of cells along y axis)
ulx, pixelwidthx, xskew, uly, yskew, pixelheighty = dem.GetGeoTransform()
#get resolution and coordinate info (for some reason the order of skew and pixel size is flipped for y axis?!)
我还可以找到最小和最大z值(以米为单位的高程):
srcband = dem.GetRasterBand(1) #get the first band (with the elevation data)
zmin,zmax,zmean,zstdv = srcband.GetStatistics(True, True) #get stats for this band (automatically ignores nan values)
但是我想要的是等效于z方向上的像素行和像素宽度。 那可能吗?如果可以,怎么办? 谢谢!