我正在尝试更改栅格(1波段)的颜色。
问题是我的输出不包含旧文件中的值。
这是我运行的命令:
gdal_translate -of GTiff -ot UInt16 C:\ndvi.vrt C:\modified_palette.tif
这是我的VRT文件:
<VRTDataset rasterXSize="1271" rasterYSize="3179">
<SRS>PROJCS["WGS 84 / UTM zone 36N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",33],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","32636"]]</SRS>
<GeoTransform> 7.3790000000000000e+05, 1.0000000000000000e+01, 0.0000000000000000e+00, 3.6828200000000000e+06, 0.0000000000000000e+00, -1.0000000000000000e+01</GeoTransform>
<Metadata>
<MDI key="AREA_OR_POINT">Area</MDI>
</Metadata>
<VRTRasterBand dataType="Float32" band="1">
<ColorInterp>Palette</ColorInterp>
<ColorTable>
<Entry c1="0" c2="0" c3="128" c4="0"/>
</ColorTable>
<SimpleSource>
<SourceFilename relativeToVRT="0">C:\ndvi.tif</SourceFilename>
<SourceBand>1</SourceBand>
<SourceProperties RasterXSize="1271" RasterYSize="3179" DataType="Float32" BlockXSize="1271" BlockYSize="1" />
<SrcRect xOff="0" yOff="0" xSize="1271" ySize="3179" />
<DstRect xOff="0" yOff="0" xSize="1271" ySize="3179" />
</SimpleSource>
</VRTRasterBand>
</VRTDataset>
谢谢