<!DOCTYPE html><html><head><title></title><style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div>HI Alistair,<br></div><div><br></div><div>I ran into a similar problem recently which may be related - see <a href="https://github.com/MapServer/MapServer/pull/7200">https://github.com/MapServer/MapServer/pull/7200</a><br></div><div>This was related to bindings though, so it may not resolve it. <br></div><div>Are you able to test your use case with this patch?<br></div><div><br></div><div>Seth<br></div><div><br></div><div id="sig62266145"><div class="signature">--<br></div><div class="signature">web:<a href="https://geographika.net">https://geographika.net</a> & <a href="https://mapserverstudio.net">https://mapserverstudio.net</a><br></div><div class="signature">mastodon: @<a href="mailto:geographika@mastodon.social">geographika@mastodon.social</a><br></div></div><div><br></div><div>On Thu, Dec 19, 2024, at 3:35 PM, Alistair Everett via MapServer-users wrote:<br></div><blockquote type="cite" id="qt" style=""><div dir="ltr"><div><br></div><div><div dir="ltr" class="qt-gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div style=""><span class="font" style="font-family:arial, helvetica, sans-serif;"><span class="color" style="color:rgb(0, 0, 0);">Hi all,</span></span><br></div><div style=""><span class="font" style="font-family:arial, helvetica, sans-serif;"><span class="color" style="color:rgb(0, 0, 0);"></span></span><br></div><div style=""><span class="font" style="font-family:arial, helvetica, sans-serif;"><span class="color" style="color:rgb(0, 0, 0);">Using the python API I'm trying to set a colorrange which includes a gradient to alpha (so that the bottom end of the colorscale is transparent). I've seen examples which suggest this should work from the mapfile eg. </span></span><a href="https://github.com/MapServer/MapServer/blob/main/msautotest/gdal/heat.map">https://github.com/MapServer/MapServer/blob/main/msautotest/gdal/heat.map</a>.<br></div><div style=""><span class="font" style="font-family:arial, helvetica, sans-serif;"><span class="color" style="color:rgb(0, 0, 0);"></span></span><br></div><div style=""><div><span class="font" style="font-family:arial, helvetica, sans-serif;"><span class="color" style="color:rgb(0, 0, 0);">I'm trying to do it using the python API, I've tried setting the max and the min like this:<br><br></span></span> color_style.maxcolor = ms.colorObj("#00ffff00")</div><div> color_style.mincolor = ms.colorObj("#000000ff")<span class="font" style="font-family:arial, helvetica, sans-serif;"><span class="color" style="color:rgb(0, 0, 0);"></span></span><br></div></div><div style=""><br></div><div style="">but the alpha value disappears when I check the color style, and also defining manually like `COLORRANGE "#00ffff00" "#000000ff"` and then using updateFromString().<br></div><div style=""><br></div><div style=""><div>When I check the string everything looks correct:<br></div><div><br></div><div style="color:rgb(59, 59, 59);font-family:"Droid Sans Mono", "monospace", monospace;font-size:14px;line-height:19px;text-wrap-mode:nowrap;"><div><div>STYLE<br></div><div> COLORRANGE "#00ffff00" "#000000ff"<br></div><div> DATARANGE 0.100000 1.000000<br></div><div>END # STYLE<br></div></div></div><div>but after I've run update from string, it seems to reinterpret as RGB without the alpha value:<br></div></div><div style=""><br></div><div style=""><div>CLASS<br></div><div> NAME "Yellow-brown shade gradient"<br></div><div> GROUP "Yellow-brown_shade_gradient"<br></div><div> STYLE<br></div><div> COLORRANGE 0 255 255 0 0 0<br></div><div> DATARANGE 0.100000 1.000000<br></div><div> END # STYLE<br></div><div>END # CLASS<br></div><div><br></div><div>And then I don't get any transparency in the resulting layer. Am I doing something wrong, or is there any way around this using the API?<br></div></div><div style=""><br></div><div style="">Thanks,<br></div><div style="">Alistair<br></div><div style=""><br></div></div></div></div></div></div></div></div></div></div></div></div><div>_______________________________________________<br></div><div>MapServer-users mailing list<br></div><div><a href="mailto:MapServer-users@lists.osgeo.org">MapServer-users@lists.osgeo.org</a><br></div><div><a href="https://lists.osgeo.org/mailman/listinfo/mapserver-users">https://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br></div><div><br></div></blockquote><div><br></div></body></html>