我一直在尝试使用给定的 gcps(XY 坐标和 Z(高程)坐标)对图像进行地理配准。但是,当我通过 gdal_translate 添加 gcps 时,它会添加高程 Z,但是一旦我使用 gdalwarp,高程就会消失,我只会得到一个 XY 参考图像。但我也需要图像中的高度。这是我的代码:
import gdal
gdal_translate -of GTiff -gcp 0 0 15329.29997 21690.27067 5412.112601 -gcp 0 724 15330.29997 21690.27067 5412.112601 -gcp 1904 0 15329.29997 21689.27067 5412.112601 -gcp 1904 724 15330.29997 21689.27067 5412.112601 test.tif out-with-gcpXYZ.tif
gdalinfo "out-with-gcpXYZ.tif"
#then
gdalwarp out-with-gcpXYZ.tif test0Z.tif
gdalinfo "test0Z.tif" #it lags the elevation (Z)