[Geoserver-users] Geoserver raster with black background

Hi there,

I'm trying to make geoserver 1.7.1 run my raster images.

I've built the Mosaic Shp file using MosaicIndexBuilder (a Nov-Dec 2007
version);

This is the scenario:

http://www.nabble.com/file/p21018416/1.png

It's showing black, instead of white or transparent (in the no data-pixels).

And this is the same scenario when i zoom into an area with data.

http://www.nabble.com/file/p21018416/2.png

Strange that the no data pixels (at the border) in the zoom in are white or
transparent.

What could be done to change that black into white or transparent?

Cumps.

D.Nunes
--
View this message in context: http://www.nabble.com/Geoserver-raster-with-black-background-tp21018416p21018416.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi,

Are you using a RasterSymbolizer for your data? My impression (and the experts can correct me if i am wrong here) but you just need to use a color map and correctly map the "nodata" value.

http://geoserver.org/display/GEOSDOC/RasterSymbolizer
http://geotools.codehaus.org/Raster+Symbolizer+support

-Justin

D.Nunes wrote:

Hi there,

I'm trying to make geoserver 1.7.1 run my raster images.

I've built the Mosaic Shp file using MosaicIndexBuilder (a Nov-Dec 2007
version);

This is the scenario:

http://www.nabble.com/file/p21018416/1.png

It's showing black, instead of white or transparent (in the no data-pixels).

And this is the same scenario when i zoom into an area with data.

http://www.nabble.com/file/p21018416/2.png

Strange that the no data pixels (at the border) in the zoom in are white or
transparent.

What could be done to change that black into white or transparent?

Cumps.

D.Nunes

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

Hello again,

i'm using the default raster.sld in geoserver 1.7.1

i've tried to add the following tags to the source raster.sld:

<RasterSymbolizer>
   <Opacity>1.0</Opacity>
<ColorMap>
   <ColorMapEntry color="#FFFFFF" quantity="1"/>
</ColorMap>
  </RasterSymbolizer>

and the result was= nothing on screen :slight_smile:

i've tried too:

<RasterSymbolizer>
   <Opacity>1.0</Opacity>
<ColorMap>
   <ColorMapEntry color="#FFFFFF" quantity="1" label="nodata"/>
</ColorMap>
  </RasterSymbolizer>

and the result was nothing on screen again.

The original works, but with the black in the nodata:

<RasterSymbolizer>
   <Opacity>1.0</Opacity>
</RasterSymbolizer>

What can i do?

Thanks 4 the help.

Cumps.

D.Nunes
--
View this message in context: http://www.nabble.com/Geoserver-raster-with-black-background-tp21018416p21038909.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi there.

i tried to use the colorMap tags:

<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0" xmlns="http://www.opengis.net/sld&quot;
xmlns:ogc="http://www.opengis.net/ogc&quot;
  xmlns:xlink="http://www.w3.org/1999/xlink&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
  xsi:schemaLocation="http://www.opengis.net/sld
http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd&quot;&gt;
  <NamedLayer>
    <Name>raster</Name>
    <UserStyle>
      <Name>raster</Name>
      <Title>Raster</Title>
      <Abstract>A sample style for rasters, good for displaying
imagery</Abstract>
      <FeatureTypeStyle>
        <FeatureTypeName>Feature</FeatureTypeName>
        <Rule>
         <RasterSymbolizer>
<ColorMap type="ramp" extended="true">
      <ColorMapEntry color="#000000" quantity="0.0" opacity="1.0"/>
      <ColorMapEntry color="#737373" quantity="2.0" opacity="1.0"/>
      <ColorMapEntry color="#666666" quantity="10.0" opacity="1.0"/>
      <ColorMapEntry color="#595959" quantity="15.0" opacity="1.0"/>
      <ColorMapEntry color="#4d4d4d" quantity="20.0" opacity="1.0"/>
      <ColorMapEntry color="#404040" quantity="25.0" opacity="1.0"/>
      <ColorMapEntry color="#333333" quantity="30.0" opacity="1.0"/>
      <ColorMapEntry color="#ffffff" quantity="100.0" opacity="1.0"/>
     </ColorMap>
        <Opacity>1.0</Opacity>
     <ChannelSelection>
      <GrayChannel>
       <SourceChannelName>1</SourceChannelName>
        <ContrastEnhancement>
         <Normalize/>
        </ContrastEnhancement>
      </GrayChannel>
     </ChannelSelection>
     <ContrastEnhancement>
      <GammaValue>1</GammaValue>
            </ContrastEnhancement>

          </RasterSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

and the result was:
http://www.nabble.com/file/p21091001/1_.png
Now, the background color is perfect.

But, now the images are with very low quality.

Zoom in
Original:
http://www.nabble.com/file/p21091001/Original.jpeg

Geoserver raster:
http://www.nabble.com/file/p21091001/2_.png

As you can see, with the "<ColorMap>" the nodata pixels disappear, but
pictures are affected.

I wounder how can it be done without quality image defect. The idea is to
maintain the image original quality.

Cumps,

D.Nunes

--
View this message in context: http://www.nabble.com/Geoserver-raster-with-black-background-tp21018416p21091001.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi,

you are using mosaic plugin right? I think that in mosaic plugin no
data areas are hardcoded to be black, which is very unpractical. If
one puts input color:#000000 and output color to:#FFFFFF it works
nice, backgound is white, but then all the black pixels on actual
image are also made white (and we dont want that)

So there should be option for color value with no data, so we can set
it to white or transparent (or any other color)

i guess is the issue:
http://jira.codehaus.org/browse/GEOT-1642

Regards,

On Fri, Dec 19, 2008 at 2:10 PM, D.Nunes <dinisnunes1@anonymised.com> wrote:

Hi there.

i tried to use the colorMap tags:

<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0" xmlns="http://www.opengis.net/sld&quot;
xmlns:ogc="http://www.opengis.net/ogc&quot;
xmlns:xlink="http://www.w3.org/1999/xlink&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:schemaLocation="http://www.opengis.net/sld
http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd&quot;&gt;
<NamedLayer>
<Name>raster</Name>
<UserStyle>
<Name>raster</Name>
<Title>Raster</Title>
<Abstract>A sample style for rasters, good for displaying
imagery</Abstract>
<FeatureTypeStyle>
<FeatureTypeName>Feature</FeatureTypeName>
<Rule>
<RasterSymbolizer>
<ColorMap type="ramp" extended="true">
<ColorMapEntry color="#000000" quantity="0.0" opacity="1.0"/>
<ColorMapEntry color="#737373" quantity="2.0" opacity="1.0"/>
<ColorMapEntry color="#666666" quantity="10.0" opacity="1.0"/>
<ColorMapEntry color="#595959" quantity="15.0" opacity="1.0"/>
<ColorMapEntry color="#4d4d4d" quantity="20.0" opacity="1.0"/>
<ColorMapEntry color="#404040" quantity="25.0" opacity="1.0"/>
<ColorMapEntry color="#333333" quantity="30.0" opacity="1.0"/>
<ColorMapEntry color="#ffffff" quantity="100.0" opacity="1.0"/>
</ColorMap>
<Opacity>1.0</Opacity>
<ChannelSelection>
<GrayChannel>
<SourceChannelName>1</SourceChannelName>
<ContrastEnhancement>
<Normalize/>
</ContrastEnhancement>
</GrayChannel>
</ChannelSelection>
<ContrastEnhancement>
<GammaValue>1</GammaValue>
</ContrastEnhancement>

     &lt;/RasterSymbolizer&gt;
   &lt;/Rule&gt;
 &lt;/FeatureTypeStyle&gt;

</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>

and the result was:
http://www.nabble.com/file/p21091001/1_.png
Now, the background color is perfect.

But, now the images are with very low quality.

Zoom in
Original:
http://www.nabble.com/file/p21091001/Original.jpeg

Geoserver raster:
http://www.nabble.com/file/p21091001/2_.png

As you can see, with the "<ColorMap>" the nodata pixels disappear, but
pictures are affected.

I wounder how can it be done without quality image defect. The idea is to
maintain the image original quality.

Cumps,

D.Nunes

--
View this message in context: http://www.nabble.com/Geoserver-raster-with-black-background-tp21018416p21091001.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
Ivan Grcic