Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

This is a bit of a beginner question I guess but I just can't find a clear answer anywhere... I have a projected satellite image (warped via gdal) and would like to set the no data pixels to a transparent value so that when the wms layer of my (image) coverage is added on my map only the projected image is displayed (and not the balck area around). Is it in the sld for my layer? is it in the wms parameters? do I need a rgba image format? etc... Any pointers would be highly appreciated! Thanks in advance. Thomas

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

You need to add a ColorMap entry for the no data value in the SLD file that is set to be transparent. See http://docs.geoserver.org/stable/en/user/styling/sld-cookbook/rasters.html for more details.

share|improve this answer
1  
Thanks for the answer. Can you develop a bit? All my attempts to use ColorMap fail. This is typically what I am doing: create a raster style with the ColorMap with <ColorMap> <ColorMapEntry color="#000000" quantity="1" opacity="0"/> </ColorMap> And then I apply it to the raster layer. –  Thomas Jun 7 '11 at 7:37
    
OK I made it work with the following: <ChannelSelection> <RedChannel> <SourceChannelName>1</SourceChannelName> </RedChannel> </ChannelSelection> <ColorMap> <ColorMapEntry color="#000000" quantity="1" opacity="0"/> <ColorMapEntry color="#000000" quantity="2" opacity="1"/> <ColorMapEntry color="#FFFFFF" quantity="256" opacity="1"/> –  Thomas Jun 7 '11 at 8:24
    
note: for multiband images this method does not work. See post gis.stackexchange.com/questions/41472/… –  xandriksson Jun 26 '13 at 11:31
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.