Update.  Now I think I understand the issue.  Here is the resolution:<div><br></div><div><span class="Apple-style-span" style="border-collapse: collapse; ">&lt;BandsCount&gt;4&lt;/BandsCount&gt; missing from the config file, not a bug.</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></div><div><span class="Apple-style-span" style="border-collapse: collapse;">Thanks!</span></div><div><span class="Apple-style-span" style="border-collapse: collapse;"><br>
</span></div><div><span class="Apple-style-span" style="border-collapse: collapse;"><br></span><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Joel Odom</b> <span dir="ltr">&lt;<a href="mailto:joelodom@gmail.com">joelodom@gmail.com</a>&gt;</span><br>
Date: Tue, Jun 23, 2009 at 12:21 PM<br>Subject: Fwd: Transparency in GDAL WMS<br>To: <a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br><br><br>For posterity, here is some information about a GDAL WMS driver issue.  I opened ticket 3042 to address this.  I hope no one minds if I paste the transcript of the conversation below.  I often search this list archive for information about GDAL issues and figure this may be useful to have in the archive.  Thanks.<div>

<br></div><div><br><div class="gmail_quote"><div class="gmail_quote">Transcript of conversation:</div><div class="im"><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div>
<div class="gmail_quote">
<span style="white-space:pre">        </span> Joel Odom &lt;<a href="mailto:joelodom@gmail.com" target="_blank">joelodom@gmail.com</a>&gt;</div></div><div class="gmail_quote">Transparency in GDAL WMS</div><div class="gmail_quote">

10 messages</div><div class="gmail_quote">Joel Odom &lt;<a href="mailto:joelodom@gmail.com" target="_blank">joelodom@gmail.com</a>&gt;<span style="white-space:pre">        </span> Tue, Jun 23, 2009 at 9:36 AM</div><div class="gmail_quote">

To: Frank Warmerdam &lt;<a href="mailto:warmerdam@pobox.com" target="_blank">warmerdam@pobox.com</a>&gt;</div><div class="im"><div class="gmail_quote">Hi, Frank.  I&#39;m hitting a WMS link that returns a PNG with transparency, but the data set raster count says that it has only three bands.  We&#39;re on GDAL 1.5.2.  Another researcher here says that newer versions of GDAL support WMS transparency, but I can&#39;t find any mention of it in this group or on in Trac.  Is it correct that this feature was put in a later release and do you know which release?  Thanks.</div>

<div class="gmail_quote"><br></div><div class="gmail_quote">(By the way, there is an early, fairly buggy, alpha of FalconView 4.3 available for free download now from <a href="http://www.falconview.org/" target="_blank">http://www.falconview.org/</a>.  We&#39;ve also posted the FalconView source code there.)</div>

<div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote">-- </div><div class="gmail_quote"><a href="http://giscoder.blogspot.com/" target="_blank">http://giscoder.blogspot.com/</a></div>

</div><div class="gmail_quote">Joel Odom &lt;<a href="mailto:joelodom@gmail.com" target="_blank">joelodom@gmail.com</a>&gt;<span style="white-space:pre">        </span> Tue, Jun 23, 2009 at 9:51 AM</div><div class="gmail_quote">

To: Frank Warmerdam &lt;<a href="mailto:warmerdam@pobox.com" target="_blank">warmerdam@pobox.com</a>&gt;</div><div class="im"><div class="gmail_quote">I think this may be what the other researcher here was looking at when he said a newer version of GDAL:  <a href="http://trac.osgeo.org/mapserver/ticket/83" target="_blank">http://trac.osgeo.org/mapserver/ticket/83</a>  This ticket refers to something about 8 years ago, though, so it&#39;s probably not the issue.</div>

<div class="gmail_quote"><br></div><div class="gmail_quote">Here is the WMS request that is returning a transparent PNG.  Any idea why I&#39;m getting this back as a three band raster and not seeing an alpha band?  Thanks so much.</div>

<div class="gmail_quote"><br></div><div class="gmail_quote"><a href="http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n1p.cgi?TRANSPARENT=TRUE&amp;request=GetMap&amp;version=1.1.0&amp;layers=nexrad-n1p&amp;styles=&amp;srs=EPSG:4326&amp;format=image/png&amp;width=948&amp;height=603&amp;bbox=-106.24059800,39.92912300,-97.79391800,45.30185300" target="_blank">http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n1p.cgi?TRANSPARENT=TRUE&amp;request=GetMap&amp;version=1.1.0&amp;layers=nexrad-n1p&amp;styles=&amp;srs=EPSG:4326&amp;format=image/png&amp;width=948&amp;height=603&amp;bbox=-106.24059800,39.92912300,-97.79391800,45.30185300</a></div>

<div class="gmail_quote"><br></div></div><div class="gmail_quote">[Quoted text hidden]</div><div class="gmail_quote">-- </div><div class="gmail_quote"><a href="http://giscoder.blogspot.com/" target="_blank">http://giscoder.blogspot.com/</a></div>

<div class="gmail_quote">Frank Warmerdam &lt;<a href="mailto:warmerdam@pobox.com" target="_blank">warmerdam@pobox.com</a>&gt;<span style="white-space:pre">        </span> Tue, Jun 23, 2009 at 10:08 AM</div><div class="gmail_quote">

To: Joel Odom &lt;<a href="mailto:joelodom@gmail.com" target="_blank">joelodom@gmail.com</a>&gt;</div><div><div></div><div class="h5"><div class="gmail_quote">Joel Odom wrote:</div><div class="gmail_quote">I think this may be what the other researcher here was looking at when he said a newer version of GDAL:  <a href="http://trac.osgeo.org/mapserver/ticket/83" target="_blank">http://trac.osgeo.org/mapserver/ticket/83</a>  This ticket refers to something about 8 years ago, though, so it&#39;s probably not the issue.</div>

<div class="gmail_quote"><br></div><div class="gmail_quote">Here is the WMS request that is returning a transparent PNG.  Any idea why I&#39;m getting this back as a three band raster and not seeing an alpha band?  Thanks so much.</div>

<div class="gmail_quote"><br></div><div class="gmail_quote"><a href="http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n1p.cgi?TRANSPARENT=TRUE&amp;request=GetMap&amp;version=1.1.0&amp;layers=nexrad-n1p&amp;styles=&amp;srs=EPSG:4326&amp;format=image/png&amp;width=948&amp;height=603&amp;bbox=-106.24059800,39.92912300,-97.79391800,45.30185300" target="_blank">http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n1p.cgi?TRANSPARENT=TRUE&amp;request=GetMap&amp;version=1.1.0&amp;layers=nexrad-n1p&amp;styles=&amp;srs=EPSG:4326&amp;format=image/png&amp;width=948&amp;height=603&amp;bbox=-106.24059800,39.92912300,-97.79391800,45.30185300</a> &lt;<a href="http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n1p.cgi?TRANSPARENT=TRUE&amp;request=GetMap&amp;version=1.1.0&amp;layers=nexrad-n1p&amp;styles=&amp;srs=EPSG:4326&amp;format=image/png&amp;width=948&amp;height=603&amp;bbox=-106.24059800,39.92912300,-97.79391800,45.30185300" target="_blank">http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n1p.cgi?TRANSPARENT=TRUE&amp;request=GetMap&amp;version=1.1.0&amp;layers=nexrad-n1p&amp;styles=&amp;srs=EPSG:4326&amp;format=image/png&amp;width=948&amp;height=603&amp;bbox=-106.24059800,39.92912300,-97.79391800,45.30185300</a>&gt;</div>

<div class="gmail_quote"><br></div><div class="gmail_quote">Joel,</div><div class="gmail_quote"><br></div><div class="gmail_quote">There are two ways of accomplishing transparency in PNG.  One is to add an</div><div class="gmail_quote">

alpha band.  The other is to designate a color index as transparent in</div><div class="gmail_quote">a single band image with a color table.  That is the approach used in this</div><div class="gmail_quote">image.</div><div class="gmail_quote">

<br></div><div class="gmail_quote">Driver: PNG/Portable Network Graphics</div><div class="gmail_quote">Files: /wrk/home/warmerda/n1p.cgi.png</div><div class="gmail_quote">Size is 948, 603</div><div class="gmail_quote">Coordinate System is `&#39;</div>

<div class="gmail_quote">Corner Coordinates:</div><div class="gmail_quote">Upper Left  (    0.0,    0.0)</div><div class="gmail_quote">Lower Left  (    0.0,  603.0)</div><div class="gmail_quote">Upper Right (  948.0,    0.0)</div>

<div class="gmail_quote">Lower Right (  948.0,  603.0)</div><div class="gmail_quote">Center      (  474.0,  301.5)</div><div class="gmail_quote">Band 1 Block=948x1 Type=Byte, ColorInterp=Palette</div><div class="gmail_quote">

 NoData Value=0</div><div class="gmail_quote"> Color Table (RGB with 45 entries)</div><div class="gmail_quote">   0: 255,255,255,0</div><div class="gmail_quote">   1: 104,34,139,255</div><div class="gmail_quote">   2: 154,50,205,255</div>

<div class="gmail_quote">   3: 178,58,238,255</div><div class="gmail_quote">   4: 191,62,255,255</div><div class="gmail_quote">   5: 153,85,201,255</div><div class="gmail_quote">...</div><div class="gmail_quote"><br></div>

<div class="gmail_quote">Note that alpha=0 in the color value for index zero.  The &quot;nodata&quot; metadata</div><div class="gmail_quote">is also set to refer to color index zero.  So for this image all zero pixels</div>

<div class="gmail_quote">should be treated as transparent.</div><div class="gmail_quote"><br></div><div class="gmail_quote">Does that address your problem?</div><div class="gmail_quote"><br></div><div class="gmail_quote">

Hopefully I can try out FalconView soon.  I skimmed the page and I&#39;m</div><div class="gmail_quote">impressed with the project.</div><div class="gmail_quote"><br></div></div></div><div class="im"><div class="gmail_quote">
Best regards,</div><div class="gmail_quote">
-- </div><div class="gmail_quote">---------------------------------------+--------------------------------------</div><div class="gmail_quote">I set the clouds in motion - turn up   | Frank Warmerdam, <a href="mailto:warmerdam@pobox.com" target="_blank">warmerdam@pobox.com</a></div>

<div class="gmail_quote">light and sound - activate the windows | <a href="http://pobox.com/~warmerdam" target="_blank">http://pobox.com/~warmerdam</a></div><div class="gmail_quote">and watch the world go round - Rush    | Geospatial Programmer for Rent</div>

<div class="gmail_quote"><br></div></div><div class="gmail_quote">Joel Odom &lt;<a href="mailto:joelodom@gmail.com" target="_blank">joelodom@gmail.com</a>&gt;<span style="white-space:pre">        </span> Tue, Jun 23, 2009 at 10:57 AM</div>

<div class="gmail_quote">To: Frank Warmerdam &lt;<a href="mailto:warmerdam@pobox.com" target="_blank">warmerdam@pobox.com</a>&gt;</div><div class="im"><div class="gmail_quote">Thanks, Frank.  That gives me a lot of insight into what&#39;s going on, but it raises a new question.  When I hit the WMS using GDALOpen on an XML file with the WMS connect data, I get something different than when I hit the URL below with my browser, save the image, then open the saved PNG file with GDALOpen.  I see the color table when I open the PNG and see the single band raster, but rasterBand-&gt;GetColorTable() returns null when I open the WMS from the XML file and I see a three band raster.  Why would I get back different data from the different data sources?  It&#39;s like the WMS data source is doing some interpretation on the image that discards original single band image and creates a new three band image with no transparency.</div>

<div class="gmail_quote"><br></div></div><div class="im"><div class="gmail_quote">Thanks for checking out FalconView.  We&#39;ve been very popular in DoD mission planning for about 15 years now.  We&#39;re opening up to the public as an open-source GIS product.  Part of that effort involves aligning with OGC standards like WMS, KML, etc.  We&#39;re using GDAL and OGR as a big part of that effort and really appreciate the product.</div>

<div class="gmail_quote"><br></div><div class="gmail_quote"><br></div></div><div class="gmail_quote">[Quoted text hidden]</div><div class="gmail_quote">-- </div><div class="gmail_quote"><a href="http://giscoder.blogspot.com/" target="_blank">http://giscoder.blogspot.com/</a></div>

<div class="gmail_quote">Frank Warmerdam &lt;<a href="mailto:warmerdam@pobox.com" target="_blank">warmerdam@pobox.com</a>&gt;<span style="white-space:pre">        </span> Tue, Jun 23, 2009 at 11:10 AM</div><div class="gmail_quote">

To: Joel Odom &lt;<a href="mailto:joelodom@gmail.com" target="_blank">joelodom@gmail.com</a>&gt;</div><div class="im"><div class="gmail_quote">Joel Odom wrote:</div><div class="gmail_quote">Thanks, Frank.  That gives me a lot of insight into what&#39;s going on, but it raises a new question.  When I hit the WMS using GDALOpen on an XML file with the WMS connect data, I get something different than when I hit the URL below with my browser, save the image, then open the saved PNG file with GDALOpen.  I see the color table when I open the PNG and see the single band raster, but rasterBand-&gt;GetColorTable() returns null when I open the WMS from the XML file and I see a three band raster.  Why would I get back different data from the different data sources?  It&#39;s like the WMS data source is doing some interpretation on the image that discards original single band image and creates a new three band image with no transparency.</div>

<div class="gmail_quote"><br></div><div class="gmail_quote">Joel,</div><div class="gmail_quote"><br></div><div class="gmail_quote">Could you provide your wms xml control file for GDAL?  I&#39;d like to try</div><div class="gmail_quote">

this.  I was not really much involved in the development of the GDAL WMS</div><div class="gmail_quote">driver so I&#39;m not clear on how it works internally.  It appears to be</div><div class="gmail_quote">doing substantial image manipulation and it might need some further</div>

<div class="gmail_quote">adjustments for this case.</div><div class="gmail_quote"><br></div><div class="gmail_quote">Thanks for checking out FalconView.  We&#39;ve been very popular in DoD mission planning for about 15 years now.  We&#39;re opening up to the public as an open-source GIS product.  Part of that effort involves aligning with OGC standards like WMS, KML, etc.  We&#39;re using GDAL and OGR as a big part of that effort and really appreciate the product.</div>

<div class="gmail_quote"><br></div><div class="gmail_quote">Excellent!</div></div><div class="gmail_quote">[Quoted text hidden]</div><div class="gmail_quote">Joel Odom &lt;<a href="mailto:joelodom@gmail.com" target="_blank">joelodom@gmail.com</a>&gt;<span style="white-space:pre">        </span> Tue, Jun 23, 2009 at 11:15 AM</div>

<div class="gmail_quote">To: Frank Warmerdam &lt;<a href="mailto:warmerdam@pobox.com" target="_blank">warmerdam@pobox.com</a>&gt;</div><div class="im"><div class="gmail_quote">Here it is.  I&#39;m constructing this as an in-memory string, saving it to an in-memory file using the VSI stuff, then calling GDALOpen on the file.  Thanks!</div>

<div class="gmail_quote"><br></div><div class="gmail_quote"><br></div></div><div class="im"><div class="gmail_quote">&lt;GDAL_WMS&gt;</div><div class="gmail_quote">  &lt;Service name=&quot;WMS&quot;&gt;</div><div class="gmail_quote">
    &lt;ServerURL&gt;<a href="http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n1p.cgi?TRANSPARENT=TRUE" target="_blank">http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n1p.cgi?TRANSPARENT=TRUE</a>&lt;/ServerURL&gt;</div>

<div class="gmail_quote">    &lt;ImageFormat&gt;image/png&lt;/ImageFormat&gt;</div><div class="gmail_quote">    &lt;Layers&gt;nexrad-n1p&lt;/Layers&gt;</div><div class="gmail_quote">  &lt;/Service&gt;</div><div class="gmail_quote">

  &lt;DataWindow&gt;</div><div class="gmail_quote">    &lt;UpperLeftX&gt;-102.017258&lt;/UpperLeftX&gt;</div><div class="gmail_quote">    &lt;UpperLeftY&gt;47.974853&lt;/UpperLeftY&gt;</div><div class="gmail_quote">    &lt;LowerRightX&gt;-93.570578&lt;/LowerRightX&gt;</div>

<div class="gmail_quote">    &lt;LowerRightY&gt;42.602123&lt;/LowerRightY&gt;</div><div class="gmail_quote">    &lt;SizeX&gt;948&lt;/SizeX&gt;</div><div class="gmail_quote">    &lt;SizeY&gt;603&lt;/SizeY&gt;</div><div class="gmail_quote">

  &lt;/DataWindow&gt;</div><div class="gmail_quote">  &lt;Timeout&gt;45&lt;/Timeout&gt;</div><div class="gmail_quote">&lt;/GDAL_WMS&gt;</div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div></div><div class="gmail_quote">

[Quoted text hidden]</div><div class="gmail_quote">-- </div><div class="gmail_quote"><a href="http://giscoder.blogspot.com/" target="_blank">http://giscoder.blogspot.com/</a></div><div class="gmail_quote">Frank Warmerdam &lt;<a href="mailto:warmerdam@pobox.com" target="_blank">warmerdam@pobox.com</a>&gt;<span style="white-space:pre">        </span> Tue, Jun 23, 2009 at 11:52 AM</div>

<div class="gmail_quote">To: Joel Odom &lt;<a href="mailto:joelodom@gmail.com" target="_blank">joelodom@gmail.com</a>&gt;</div><div class="im"><div class="gmail_quote">Joel Odom wrote:</div><div class="gmail_quote">Here it is.  I&#39;m constructing this as an in-memory string, saving it to an in-memory file using the VSI stuff, then calling GDALOpen on the file.  Thanks!</div>

<div class="gmail_quote"><br></div><div class="gmail_quote">Joel,</div><div class="gmail_quote"><br></div><div class="gmail_quote">I see what you mean.  I believe the approach taken in the WMS driver is</div><div class="gmail_quote">

essentially obliterating any concept of transparency in the result.  It</div><div class="gmail_quote">would take some non-trivial additional development in the WMS driver to</div><div class="gmail_quote">address this issue.  I&#39;m not in a position to do it.</div>

<div class="gmail_quote"><br></div><div class="gmail_quote">You might want to take up the issue with Adam Nowaki who wrote the the</div><div class="gmail_quote">driver.  Possibly I&#39;m missing something, or perhaps he would be willing</div>

<div class="gmail_quote">to do some work on this.</div></div><div class="gmail_quote">[Quoted text hidden]</div><div class="gmail_quote">Joel Odom &lt;<a href="mailto:joelodom@gmail.com" target="_blank">joelodom@gmail.com</a>&gt;<span style="white-space:pre">        </span> Tue, Jun 23, 2009 at 11:55 AM</div>

<div class="gmail_quote">To: Frank Warmerdam &lt;<a href="mailto:warmerdam@pobox.com" target="_blank">warmerdam@pobox.com</a>&gt;</div><div class="gmail_quote">Cc: Chris Bailey &lt;<a href="mailto:chris.bailey@gtri.gatech.edu" target="_blank">chris.bailey@gtri.gatech.edu</a>&gt;</div>
<div class="im">
<div class="gmail_quote">Thanks, Frank.  I appreciate that.  My work-around for now is to request the URL myself then have GDAL interpret the image using whatever driver it finds appropriate for the binary image.  I&#39;ve almost got that working.</div>

<div class="gmail_quote"><br></div><div class="gmail_quote">Would you mind if I posted this conversation to the GDAL developers list for posterity and opened a ticket for this issue?</div><div class="gmail_quote"><br></div>

</div><div class="gmail_quote">Thanks again.</div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote">[Quoted text hidden]</div><div class="gmail_quote">-- </div><div class="gmail_quote">

<a href="http://giscoder.blogspot.com/" target="_blank">http://giscoder.blogspot.com/</a></div><div class="gmail_quote">Frank Warmerdam &lt;<a href="mailto:warmerdam@pobox.com" target="_blank">warmerdam@pobox.com</a>&gt;<span style="white-space:pre">        </span> Tue, Jun 23, 2009 at 12:01 PM</div>

<div class="gmail_quote">To: Joel Odom &lt;<a href="mailto:joelodom@gmail.com" target="_blank">joelodom@gmail.com</a>&gt;</div><div class="gmail_quote">Cc: Chris Bailey &lt;<a href="mailto:chris.bailey@gtri.gatech.edu" target="_blank">chris.bailey@gtri.gatech.edu</a>&gt;</div>
<div class="im">
<div class="gmail_quote">Joel Odom wrote:</div><div class="gmail_quote">Thanks, Frank.  I appreciate that.  My work-around for now is to request the URL myself then have GDAL interpret the image using whatever driver it finds appropriate for the binary image.  I&#39;ve almost got that working.</div>

<div class="gmail_quote"><br></div><div class="gmail_quote">Would you mind if I posted this conversation to the GDAL developers list for posterity and opened a ticket for this issue?</div><div class="gmail_quote"><br></div>

<div class="gmail_quote">Joel,</div><div class="gmail_quote"><br></div><div class="gmail_quote">That would be an excellent idea.</div></div><div class="gmail_quote">[Quoted text hidden]</div><div class="gmail_quote">Joel Odom &lt;<a href="mailto:joelodom@gmail.com" target="_blank">joelodom@gmail.com</a>&gt;<span style="white-space:pre">        </span> Tue, Jun 23, 2009 at 12:17 PM</div>

<div class="gmail_quote">Draft To: <a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a></div><div class="gmail_quote">For posterity, here is some information about a GDAL WMS driver issue.  I opened ticket 3042 to address this.  Thanks.</div>

<div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote">[Quoted text hidden]</div><div class="gmail_quote">-- </div><div class="gmail_quote"><a href="http://giscoder.blogspot.com/" target="_blank">http://giscoder.blogspot.com/</a></div>

<div><br></div></div><br clear="all"><br>-- <br><a href="http://giscoder.blogspot.com/" target="_blank">http://giscoder.blogspot.com/</a><br>
</div>
</div><br><br clear="all"><br>-- <br><a href="http://giscoder.blogspot.com/">http://giscoder.blogspot.com/</a><br>
</div>