<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="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace">6010 255 255 255 255</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">2700 247 229 200 255</font></div><div><font class="Apple-style-span" face="'courier new', monospace">2200 224 192 164 255</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">2000 150 101 48 255</font></div><div><font class="Apple-style-span" face="'courier new', monospace">1800 168 134 64 255</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">1600 204 170 102 255</font></div><div><font class="Apple-style-span" face="'courier new', monospace">1400 219 198 129 255</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">1200 206 206 126 255</font></div><div><font class="Apple-style-span" face="'courier new', monospace">1000 168 186 114 255</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">750 130 157 85 255</font></div><div><font class="Apple-style-span" face="'courier new', monospace">500 105 134 79 255</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">300 82 120 71 255</font></div><div><font class="Apple-style-span" face="'courier new', monospace">0 82 120 71 255</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">nv 0 0 0 0</font></div><div><br></div><div><br></div><div><font class="Apple-style-span" face="'courier new', monospace">$ gdalinfo test.tif</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">Driver: GTiff/GeoTIFF</font></div><div><font class="Apple-style-span" face="'courier new', monospace">Files: test.tif</font></div><div><font class="Apple-style-span" face="'courier new', monospace">Size is 8545, 6741</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">Coordinate System is:</font></div><div><font class="Apple-style-span" face="'courier new', monospace">PROJCS["NAD_1983_CSRS_BC_Environment_Albers",</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> GEOGCS["GCS_North_American_1983_CSRS",</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> DATUM["North_American_1983_CSRS",</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> SPHEROID["GRS_1980",6378137,298.257222101]],</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> PRIMEM["Greenwich",0],</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> UNIT["degree",0.0174532925199433]],</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> PROJECTION["Albers_Conic_Equal_Area"],</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> PARAMETER["standard_parallel_1",50],</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> PARAMETER["standard_parallel_2",58.5],</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> PARAMETER["latitude_of_center",45],</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> PARAMETER["longitude_of_center",-126],</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> PARAMETER["false_easting",1000000],</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> PARAMETER["false_northing",0],</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> UNIT["metre",1,</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> AUTHORITY["EPSG","9001"]]]</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">Origin = (-3267710.539297561161220,4568786.377016356214881)</font></div><div><font class="Apple-style-span" face="'courier new', monospace">Pixel Size = (758.984955600446028,-758.984955600446028)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">Metadata:</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> AREA_OR_POINT=Area</font></div><div><font class="Apple-style-span" face="'courier new', monospace">Image Structure Metadata:</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> INTERLEAVE=BAND</font></div><div><font class="Apple-style-span" face="'courier new', monospace">Corner Coordinates:</font></div><div><font class="Apple-style-span" face="'courier new', monospace">Upper Left (-3267710.539, 4568786.377) (140d 2'31.59"E, 56d 4'47.55"N)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">Lower Left (-3267710.539, -547531.209) (168d48' 5.40"W, 27d27'32.14"N)</font></div><div><font class="Apple-style-span" face="'courier new', monospace">Upper Right ( 3217815.906, 4568786.377) ( 46d22'30.99"W, 74d 3'20.87"N)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">Lower Right ( 3217815.906, -547531.209) (101d35'47.90"W, 36d25'26.60"N)</font></div><div><font class="Apple-style-span" face="'courier new', monospace">Center ( -24947.316, 2010627.584) (145d32'21.90"W, 61d48' 4.50"N)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">Band 1 Block=8545x1 Type=Int32, ColorInterp=Gray</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> Min=1.000 Max=6009.000</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> Minimum=1.000, Maximum=6009.000, Mean=757.173, StdDev=613.626</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> NoData Value=-9999</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> Metadata:</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> STATISTICS_MAXIMUM=6009</font></div><div>
<font class="Apple-style-span" face="'courier new', monospace"> STATISTICS_MEAN=757.17319855878</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> STATISTICS_MINIMUM=1</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> STATISTICS_STDDEV=613.62557570411</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div>
<font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace">$ gdalinfo test2.tif</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><div>Driver: GTiff/GeoTIFF</div><div>Files: test2.tif</div><div>Size is 8545, 6741</div><div>Coordinate System is:</div><div>PROJCS["NAD_1983_CSRS_BC_Environment_Albers",</div>
<div> GEOGCS["GCS_North_American_1983_CSRS",</div><div> DATUM["North_American_1983_CSRS",</div><div> SPHEROID["GRS_1980",6378137,298.257222101]],</div><div> PRIMEM["Greenwich",0],</div>
<div> UNIT["degree",0.0174532925199433]],</div><div> PROJECTION["Albers_Conic_Equal_Area"],</div><div> PARAMETER["standard_parallel_1",50],</div><div> PARAMETER["standard_parallel_2",58.5],</div>
<div> PARAMETER["latitude_of_center",45],</div><div> PARAMETER["longitude_of_center",-126],</div><div> PARAMETER["false_easting",1000000],</div><div> PARAMETER["false_northing",0],</div>
<div> UNIT["metre",1,</div><div> AUTHORITY["EPSG","9001"]]]</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'31.59"E, 56d 4'47.55"N)</div>
<div>Lower Left (-3267710.539, -547531.209) (168d48' 5.40"W, 27d27'32.14"N)</div><div>Upper Right ( 3217815.906, 4568786.377) ( 46d22'30.99"W, 74d 3'20.87"N)</div><div>Lower Right ( 3217815.906, -547531.209) (101d35'47.90"W, 36d25'26.60"N)</div>
<div>Center ( -24947.316, 2010627.584) (145d32'21.90"W, 61d48' 4.50"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>