0

I have a problem with a blue-ish overlay color over my WMS layer that only is visible if there is part of the image background (nodata area) in the requested map extent.

The original image is a facsimile of an old map. It is georeferenced, resulting in approx. 45° rotation. Thus, the GeoTiff has large "no data" areas in the corners.

See original image, which is displayed correctly by geoserver's wms if there is no nodata visible in the requested extent:

Original image colors, wms serves those when no nodata area is visible in the requested extent

...and if the nodata area on the bottom left is inside the viewport, it looks like this:

Blue-ish color that appears when a part of the "nodata frame" around the image is visible

The SLD file used is

<?xml version="1.0" encoding="UTF-8"?><sld:StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:sld="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" version="1.0.0">
  <sld:NamedLayer>
    <sld:Name>B0448_7c</sld:Name>
    <sld:UserStyle>
      <sld:Name>B0448_7c</sld:Name>
      <sld:FeatureTypeStyle>
        <sld:Rule>
          <sld:RasterSymbolizer>
            <sld:Geometry>
              <ogc:PropertyName>grid</ogc:PropertyName>
            </sld:Geometry>
            <sld:ChannelSelection>
              <sld:RedChannel>
                <sld:SourceChannelName>1</sld:SourceChannelName>
                <sld:ContrastEnhancement>
                  <sld:GammaValue>1.0</sld:GammaValue>
                </sld:ContrastEnhancement>
              </sld:RedChannel>
              <sld:GreenChannel>
                <sld:SourceChannelName>2</sld:SourceChannelName>
                <sld:ContrastEnhancement>
                  <sld:GammaValue>1.0</sld:GammaValue>
                </sld:ContrastEnhancement>
              </sld:GreenChannel>
              <sld:BlueChannel>
                <sld:SourceChannelName>3</sld:SourceChannelName>
                <sld:ContrastEnhancement>
                  <sld:GammaValue>1.0</sld:GammaValue>
                </sld:ContrastEnhancement>
              </sld:BlueChannel>
            </sld:ChannelSelection>
            <sld:ContrastEnhancement/>
          </sld:RasterSymbolizer>
        </sld:Rule>
      </sld:FeatureTypeStyle>
    </sld:UserStyle>
  </sld:NamedLayer>
</sld:StyledLayerDescriptor>

If I set the layers InputTransparentColor to #000000 the wms will not show anything (only a white background in OpenLayers preview).

Unfortunately I cannot share the geotiff because it contains proprietary data.

How can I get rid of the blue?

UPDATE: I have now narrowed my problem down to (I think) a custom color stretch applied for every rendered tile and not for the whole raster. When using the options toolbar in the openlayers preview and viewing as tiled, all tiles will have a slightly different color scheme. Inner tiles (which dont touch the nodata areas on the edges) are near the original color, tiles containing the edges are blue-ish.

  • try using a colormap instead of relying on the histogram stretch that is default – Ian Turton Oct 22 '15 at 12:09
  • Is there an example somewhere for creating a colormap for a color GEOTIFF image? I can only find examples for DEM-like single channel geotiffs, where the pixel value denotes height. – til_b Oct 23 '15 at 8:37
  • 1
    The easiest way to fix this is to perform the contrast stretch once using GDAL or QGIS. It looks like your geotiff is 16 bits and geoserver performs a local stretch to 8 bits. – simogeo Oct 28 '15 at 11:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.