<html><head></head><body><div class="ydpd1faad8ayahoo-style-wrap" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 13px;"><div></div>
        <div>Hi Even,</div><div><br></div><div>I am passing something like this</div><div><span>ds = gdal.DEMProcessing('color-relief', file, outfile, options=[-alpha], colorFilename = 'data/file.txt')</span><br></div><div><span><br></span></div><div><span>But I get an error message too:</span></div><div><span><span><pre style="font-size: 14px; padding: 1px 0px; margin-top: 0px; margin-bottom: 0px; line-height: inherit; color: rgb(0, 0, 0); border: 0px; border-radius: 0px; white-space: pre-wrap; vertical-align: baseline;"><span class="ydpb266c336ansi-red-fg" style="color: rgb(231, 92, 88);">NameError</span>: name 'alpha' is not defined</pre></span></span></div><div><br></div><div>The bash syntax would be:</div><div><span>gdaldem color-relief file1.tif -alpha hramp.txt file2.tif</span><br></div><div><span><br></span></div><div><span>Thanks,</span></div><div><span>Corina</span></div><div><br></div>
        
        </div><div id="yahoo_quoted_9847620278" class="yahoo_quoted">
            <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
                
                <div>
                    On Wednesday, 6 February 2019, 16:14:56 GMT, Even Rouault <even.rouault@spatialys.com> wrote:
                </div>
                <div><br></div>
                <div><br></div>
                <div><div dir="ltr">On mercredi 6 fĂ©vrier 2019 08:17:03 CET Corina Tudorache wrote:<br></div><div dir="ltr">> Hi list,<br></div><div dir="ltr">> <br></div><div dir="ltr">> I have been trying to use gdaldem in python to set the background color to<br></div><div dir="ltr">> transparent. Unfortunately gdaldem doesnt recognise addAlpha = True, i get<br></div><div dir="ltr">> this error message:<br></div><div dir="ltr">> TypeError: DEMProcessingOptions() got an unexpected keyword argument<br></div><div dir="ltr">> 'addAlpha'<br></div><div dir="ltr">> <br></div><div dir="ltr">> ds = gdal.DEMProcessing(infile, outfile, 'color-relief', format = 'MEM',<br></div><div dir="ltr">> colorFilename = '/data/file.txt', addAlpha = True)<br></div><div dir="ltr">> <br></div><div dir="ltr">> Is there a way to fix this behaviour?<br></div><div dir="ltr"><br></div><div dir="ltr">This was added in GDAL 2.3.0<br></div><div dir="ltr">As a workaround you can use the options= keyword and format its value with <br></div><div dir="ltr">what you would put on the gdaldem command line<br></div><div dir="ltr"><br></div><div dir="ltr">Even<br></div><div dir="ltr"><br></div><div dir="ltr">-- <br></div><div dir="ltr">Spatialys - Geospatial professional services<br></div><div dir="ltr"><a href="http://www.spatialys.com" target="_blank">http://www.spatialys.com</a></div></div>
            </div>
        </div></body></html>