python - 获取 DEM 栅格文件的垂直 (z) 分辨率(使用 gdal 和 python)?
问题描述
我想找到 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 方向上相当于 nrows 和像素宽度。那可能吗?如果有怎么办?谢谢!
解决方案
推荐阅读
- debian - 列出在 debian buster 上手动安装的 apt 包
- sublimetext3 - Sublime Text 3 未将当前目录中的文件加载到侧边栏
- kubernetes - Kubernetes 上的 Nginx 入口控制器不允许安装某些软件包
- azure-devops - 从 Azure Devops 中删除所需的审阅者
- html - 如何为滚动标题制作磨砂玻璃效果
- oracle - 带符号的列名
- c# - WPF DataGrid - 透明的水平网格线,最后一行的底部水平线除外
- php - 在php中输入直接地址时重定向页面
- python - SSL:策展人访问弹性搜索时出现 CERTIFICATE_VERIFY_FAILED 错误
- sql - 将包含数据的完整 CSV 结构复制到数据表