1 밴드 GeoTIFF 파일이 있습니다. 밴드의 색상 해석은 회색입니다. 내 변환하기 위해 색상 표를 원하는 Col.tiff
에를 Col.jpeg
나 Col.png
.
.vrt를 통해이 tiff에 색상 표를 넣으려고했습니다.
gdal_translate -of VRT Col.tiff Col.vrt
그런 다음 .vrt에 추가하십시오.
<ColorInterp>Palette</ColorInterp>
<ColorTable>
<Entry c1="0" c2="0" c3="255" c4="240"/>
<Entry c1="0" c2="0" c3="254" c4="240"/>
<Entry c1="0" c2="0" c3="253" c4="240"/>
<Entry c1="0" c2="0" c3="252" c4="240"/>
</ColorTable>
그리고 다시 번역하십시오 :
gdal_translate Col.vrt Col.tiff
그러나 그것은 대답했다 :
Warning 1: Unable to export color table to GeoTIFF file. Color tables can only be written to 1 band or 2 bands Byte or UInt16 GeoTIFF files.
어떻게하니?
자세한 내용은 밴드에 대한 gdalinfo가 있습니다.
Band 1 Block=55x18 Type=Float64, ColorInterp=Gray
Description = Something
Metadata:
GRIB_COMMENT=Something[p]
GRIB_ELEMENT=TMP
GRIB_FORECAST_SECONDS=0 sec
GRIB_REF_TIME=1401926400 sec UTC
GRIB_SHORT_NAME=SMTHG
GRIB_UNIT=[p]
GRIB_VALID_TIME=1401926400 sec UTC
답변
gdal을 사용하면 gdal_dem ( color_relief )을 기반으로 이미지를 채색 할 수 있습니다
색상 구성 파일의 구문은 GRASS r.colors 유틸리티가 지원하는 구문에서 파생됩니다 . ESRI HDR 색상 표 파일 (.clr)도 해당 구문과 일치합니다. 알파 구성 요소 및 구분 기호로 탭 및 쉼표 지원은 GDAL 전용 확장입니다.
aspect: aspect oriented grey colors aspectcolr: aspect oriented rainbow colors bcyr: blue through cyan through yellow to red bgyr: blue through green through yellow to red byg: blue through yellow to green byr: blue through yellow to red celsius: blue to red for degree Celsius temperature corine: EU Corine land cover colors curvature: for terrain curvatures (from v.surf.rst and r.slope.aspect) differences: differences oriented colors elevation: maps relative ranges of raster values to elevation color ramp etopo2: colors for ETOPO2 worldwide bathymetry/topography evi: enhanced vegetative index colors gdd: accumulated growing degree days grey: grey scale grey.eq: histogram-equalized grey scale grey.log: histogram logarithmic transformed grey scale grey1.0: grey scale for raster values between 0.0-1.0 grey255: grey scale for raster values between 0-255 gyr: green through yellow to red haxby: relative colors for bathymetry or topography ndvi: Normalized Difference Vegetation Index colors population: color table covering human population classification breaks population_dens: color table covering human population density classification breaks precipitation: precipitation color table (0..2000mm) precipitation_monthly: precipitation color table (0..1000mm) rainbow: rainbow color table ramp: color ramp random: random color table rstcurv: terrain curvature (from r.resamp.rst) rules: create new color table based on user-specified rules read from stdin ryb: red through yellow to blue ryg: red through yellow to green sepia: yellowish-brown through to white slope: r.slope.aspect-type slope colors for raster values 0-90 srtm: color palette for Shuttle Radar Topography Mission elevation terrain: global elevation color table covering -11000 to +8850m wave: color wave