[英]Passing additional options to gdal.Translate
我有一个定义栅格数据集转换的vrt
文件,我想将其转换为一组gdal.Warp
或gdal.Translate
命令:
<VRTDataset rasterXSize="100" rasterYSize="100">
<VRTRasterBand dataType="Int16" band="1">
<NoDataValue>0</NoDataValue>
<SimpleSource>
<SourceFilename relativeToVRT="1">input.tiff</SourceFilename>
<SourceBand>1</SourceBand>
<SourceProperties RasterXSize="1000" RasterYSize="1000" DataType="Int16"/>
<SrcRect xOff="25" yOff="200" xSize="50" ySize="50"/>
<DstRect xOff="25" yOff="25" xSize="50" ySize="50"/>
</SimpleSource>
</VRTRasterBand>
</VRTDataset>
这种转变做了两件事:
input.tiff
。NoData
缓冲区。现在我有这个:
from osgeo import gdal
input_image = gdal.Open('input.tiff')
input_image_window = [25, 200, 50, 50]
gdal.Translate('output.tiff', input_image, srcWin=input_image_window, noData=0)
但是我找不到在gdal.Translate
或gdal.Warp
中定义DstRect
的等效参数。 我已经为此检查了文档,似乎在 python 绑定 arguments 中没有等效项。有谁知道如何提供DstRect
或类似的 arguments 到gdal.Translate
?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.