GeoTransform = list(GeoTransform)
GeoTransform[2] = 0.0 # set the new RowRotation here!
GeoTransform[-2] = 0.0 # set the new ColRotation here!
GeoTransform = tuple(GeoTransform)
Image.SetGeoTransform(GeoTransform) # write GeoTransform to image
del Image # close the dataset
您可以通过modifying the GeoTransform来完成此操作。如果要“就地”修改GDAL图像(即不创建新图像),可以在读写模式下打开该图像:
GeoTransform是包含以下属性的元组: (UpperLeftX、PixelSizeX、RowRotation、UpperLeftY、ColRotation,-PixelSizeY)
元组在Python中是不可变的,因此要修改GeoTransform,必须将其转换为列表,然后在将其写入GDAL图像之前再次还原为元组:
相关问题 更多 >
编程相关推荐