Uploaded image for project: 'GeoServer'
  1. GEOS-7845

Raster styling: ChannelSelection/ContrastEnhancement not working properly

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 2.10.0
    • Fix Version/s: 2.12-beta, 2.11.2, 2.10.5
    • Component/s: WMS
    • Environment:

      Ubuntu 16.04 Server x64, Oracle Java 1.8, Native JAI

      Description

      The same style which I posted in GEOS-7235 Open does not work under 2.10.0 any more. Within the <ChannelSelection> I can permute values for <SourceChannelName> freely without having an effect on the result. Also my VendorOptions are not interpreted at all. GeoServer's log does not print any errors and the server returns a regular image, as if rendered with the default raster-style.

      Here is the style from GEOS-7235:

      <?xml version="1.0" encoding="ISO-8859-1"?>
      <StyledLayerDescriptor version="1.0.0" 
       xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd" 
       xmlns="http://www.opengis.net/sld" 
       xmlns:ogc="http://www.opengis.net/ogc" 
       xmlns:xlink="http://www.w3.org/1999/xlink" 
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <NamedLayer>
          <Name>raster_contrast</Name>
          <UserStyle>
            <Title>Raster Contrast Enhancement</Title>
            <Abstract>Raster style with custom contrast adjustment</Abstract>
            <FeatureTypeStyle>
              <Rule>
                <Name>rule1</Name>
                <Title>Opaque Raster</Title>
                <Abstract>A raster with 100% opacity and custom contrast</Abstract>
                <RasterSymbolizer>
                  <Opacity>1.0</Opacity>
                  <ChannelSelection>
                    <RedChannel>
                      <SourceChannelName>1</SourceChannelName>
                      <ContrastEnhancement>
                        <Normalize>
                          <VendorOption name="algorithm">StretchToMinimumMaximum</VendorOption>
                          <VendorOption name="minValue">33</VendorOption>
                          <VendorOption name="maxValue">227</VendorOption>
                        </Normalize>
                        <GammaValue>0.6</GammaValue>
                      </ContrastEnhancement>
                    </RedChannel>
                    <GreenChannel>
                      <SourceChannelName>2</SourceChannelName>
                      <ContrastEnhancement>
                        <Normalize>
                          <VendorOption name="algorithm">StretchToMinimumMaximum</VendorOption>
                          <VendorOption name="minValue">44</VendorOption>
                          <VendorOption name="maxValue">225</VendorOption>
                        </Normalize>
                        <GammaValue>0.6</GammaValue>
                      </ContrastEnhancement>                
                    </GreenChannel>
                    <BlueChannel>
                      <SourceChannelName>3</SourceChannelName>
                      <ContrastEnhancement>
                        <Normalize>
                          <VendorOption name="algorithm">StretchToMinimumMaximum</VendorOption>
                          <VendorOption name="minValue">46</VendorOption>
                          <VendorOption name="maxValue">227</VendorOption>
                        </Normalize>
                        <GammaValue>0.6</GammaValue>
                      </ContrastEnhancement>                
                    </BlueChannel>
                  </ChannelSelection>            
                </RasterSymbolizer>
              </Rule>
            </FeatureTypeStyle>
          </UserStyle>
        </NamedLayer>
      </StyledLayerDescriptor>
      

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                dany111 Daniele Romagnoli
                Reporter:
                michikommader Michael Scholz
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: