我正在尝试堆叠光栅.tif文件我有12个.tif文件,但我还想用python压缩输出堆叠文件
这是我当前用于堆叠文件的工作代码,但堆叠后文件的大小非常大
from osgeo import gdal
outvrt='/vsimen/Stacked.tif'
outtif='E:/Users/Compressed_files/Stacked.tif'
tifs=glob.glob('E:/Users/Compressed_files/*.tif')
outds=gdal.BuildVRT(outvrt,tifs,seperate=True)
outds=gdal.Translate(outtif,outds)
可以将TranslateOptions对象传递给
gdalTranslate
调用,在该调用中可以添加相关的creationOptions
进行压缩因此,作为虚拟代码:
当然,这些选项也可以是一个字符串或字符串数组-不必使用
TranslateOptions
此外,虚拟代码中使用的压缩设置只是一个示例。为了最大化您的收益,您应该选择与您的数据相关的选项
以下是documentation on available options for GeoTiffs的摘录:
相关问题 更多 >
编程相关推荐