<div>Hi All,</div><div><br></div><div>I am trying to create an RGBA geotiff using gdaldem color-relief. When I load the output geotiff into QGIS, all the NoData values appear black, so I loaded the geotiff into R (using rgdal) and all the values in the the alpha band are 255, none are 0. </div>
<div>What am I doing wrong? Thanks in advance,</div><div>Hailey</div><div><br></div><div>Here are my steps:</div><div><br></div><div>$ gdaldem color-relief test.tif colors.txt test2.tif -alpha -co ALPHA=YES</div><div><br>
</div><div>where colors.txt:</div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace"><br></font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">6010    255     255     255     255</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">2700    247     229     200     255</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">2200    224     192     164     255</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">2000    150     101     48      255</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">1800    168     134     64      255</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">1600    204     170     102     255</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">1400    219     198     129     255</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">1200    206     206     126     255</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">1000    168     186     114     255</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">750     130     157     85      255</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">500     105     134     79      255</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">300     82      120     71      255</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">0       82      120     71      255</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">nv      0       0       0       0</font></div><div><br></div><div><br></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">$ gdalinfo test.tif</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">Driver: GTiff/GeoTIFF</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">Files: test.tif</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">Size is 8545, 6741</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">Coordinate System is:</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">PROJCS[&quot;NAD_1983_CSRS_BC_Environment_Albers&quot;,</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">    GEOGCS[&quot;GCS_North_American_1983_CSRS&quot;,</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">        DATUM[&quot;North_American_1983_CSRS&quot;,</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">            SPHEROID[&quot;GRS_1980&quot;,6378137,298.257222101]],</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">        PRIMEM[&quot;Greenwich&quot;,0],</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">        UNIT[&quot;degree&quot;,0.0174532925199433]],</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">    PROJECTION[&quot;Albers_Conic_Equal_Area&quot;],</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">    PARAMETER[&quot;standard_parallel_1&quot;,50],</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">    PARAMETER[&quot;standard_parallel_2&quot;,58.5],</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">    PARAMETER[&quot;latitude_of_center&quot;,45],</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">    PARAMETER[&quot;longitude_of_center&quot;,-126],</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">    PARAMETER[&quot;false_easting&quot;,1000000],</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">    PARAMETER[&quot;false_northing&quot;,0],</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">    UNIT[&quot;metre&quot;,1,</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">        AUTHORITY[&quot;EPSG&quot;,&quot;9001&quot;]]]</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">Origin = (-3267710.539297561161220,4568786.377016356214881)</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">Pixel Size = (758.984955600446028,-758.984955600446028)</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">Metadata:</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">  AREA_OR_POINT=Area</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">Image Structure Metadata:</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">  INTERLEAVE=BAND</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">Corner Coordinates:</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">Upper Left  (-3267710.539, 4568786.377) (140d 2&#39;31.59&quot;E, 56d 4&#39;47.55&quot;N)</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">Lower Left  (-3267710.539, -547531.209) (168d48&#39; 5.40&quot;W, 27d27&#39;32.14&quot;N)</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">Upper Right ( 3217815.906, 4568786.377) ( 46d22&#39;30.99&quot;W, 74d 3&#39;20.87&quot;N)</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">Lower Right ( 3217815.906, -547531.209) (101d35&#39;47.90&quot;W, 36d25&#39;26.60&quot;N)</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">Center      (  -24947.316, 2010627.584) (145d32&#39;21.90&quot;W, 61d48&#39; 4.50&quot;N)</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">Band 1 Block=8545x1 Type=Int32, ColorInterp=Gray</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">  Min=1.000 Max=6009.000</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">  Minimum=1.000, Maximum=6009.000, Mean=757.173, StdDev=613.626</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">  NoData Value=-9999</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">  Metadata:</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">    STATISTICS_MAXIMUM=6009</font></div><div>
<font class="Apple-style-span" face="&#39;courier new&#39;, monospace">    STATISTICS_MEAN=757.17319855878</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">    STATISTICS_MINIMUM=1</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">    STATISTICS_STDDEV=613.62557570411</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace"><br></font></div><div>
<font class="Apple-style-span" face="&#39;courier new&#39;, monospace"><br></font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace"><br></font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">$ gdalinfo test2.tif</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace"><div>Driver: GTiff/GeoTIFF</div><div>Files: test2.tif</div><div>Size is 8545, 6741</div><div>Coordinate System is:</div><div>PROJCS[&quot;NAD_1983_CSRS_BC_Environment_Albers&quot;,</div>
<div>    GEOGCS[&quot;GCS_North_American_1983_CSRS&quot;,</div><div>        DATUM[&quot;North_American_1983_CSRS&quot;,</div><div>            SPHEROID[&quot;GRS_1980&quot;,6378137,298.257222101]],</div><div>        PRIMEM[&quot;Greenwich&quot;,0],</div>
<div>        UNIT[&quot;degree&quot;,0.0174532925199433]],</div><div>    PROJECTION[&quot;Albers_Conic_Equal_Area&quot;],</div><div>    PARAMETER[&quot;standard_parallel_1&quot;,50],</div><div>    PARAMETER[&quot;standard_parallel_2&quot;,58.5],</div>
<div>    PARAMETER[&quot;latitude_of_center&quot;,45],</div><div>    PARAMETER[&quot;longitude_of_center&quot;,-126],</div><div>    PARAMETER[&quot;false_easting&quot;,1000000],</div><div>    PARAMETER[&quot;false_northing&quot;,0],</div>
<div>    UNIT[&quot;metre&quot;,1,</div><div>        AUTHORITY[&quot;EPSG&quot;,&quot;9001&quot;]]]</div><div>Origin = (-3267710.539297561161220,4568786.377016356214881)</div><div>Pixel Size = (758.984955600446028,-758.984955600446028)</div>
<div>Metadata:</div><div>  AREA_OR_POINT=Area</div><div>Image Structure Metadata:</div><div>  INTERLEAVE=PIXEL</div><div>Corner Coordinates:</div><div>Upper Left  (-3267710.539, 4568786.377) (140d 2&#39;31.59&quot;E, 56d 4&#39;47.55&quot;N)</div>
<div>Lower Left  (-3267710.539, -547531.209) (168d48&#39; 5.40&quot;W, 27d27&#39;32.14&quot;N)</div><div>Upper Right ( 3217815.906, 4568786.377) ( 46d22&#39;30.99&quot;W, 74d 3&#39;20.87&quot;N)</div><div>Lower Right ( 3217815.906, -547531.209) (101d35&#39;47.90&quot;W, 36d25&#39;26.60&quot;N)</div>
<div>Center      (  -24947.316, 2010627.584) (145d32&#39;21.90&quot;W, 61d48&#39; 4.50&quot;N)</div><div>Band 1 Block=8545x1 Type=Byte, ColorInterp=Red</div><div>  Mask Flags: PER_DATASET ALPHA</div><div>Band 2 Block=8545x1 Type=Byte, ColorInterp=Green</div>
<div>  Mask Flags: PER_DATASET ALPHA</div><div>Band 3 Block=8545x1 Type=Byte, ColorInterp=Blue</div><div>  Mask Flags: PER_DATASET ALPHA</div><div>Band 4 Block=8545x1 Type=Byte, ColorInterp=Alpha</div><div><br></div></font></div>