I have a 4 channel(RGB+NIR) GeoTIFF(nodata=0) in uintformat. I use this image for WMS(base map) also use for WCS. I use below SLD style for RGB and it works fine(please check edit-2 ) but with RGB+NIR it comes blank space. Also, if I don't use block that contains min and max pixel values, SLD style works fine but contrast is not good. Because of the storage issue, I want to use same image for both services.
WMTS layer(localhost:8080/geoserver/gwc/demo/layer1:sld?gridSet=EPSG:4326&format=image/png) for RGB image(3band), after zoom level 7, it comes blanks space again. With default raster SLD,everything seems fine.
After WMTS error, I've checked WMS for RGB image(3band) and there is same error. After zoom level 7 it gives blank page. When I click the blank screen I can get pixel value. With default raster SLD, everything seems fine.
<?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:UserLayer>
<sld:LayerFeatureConstraints>
<sld:FeatureTypeConstraint/>
</sld:LayerFeatureConstraints>
<sld:UserStyle>
<sld:Title/>
<sld:FeatureTypeStyle>
<sld:Name>name</sld:Name>
<sld:FeatureTypeName>Feature</sld:FeatureTypeName>
<sld:Rule>
<sld:MinScaleDenominator>75000</sld:MinScaleDenominator>
<RasterSymbolizer>
<Opacity>1.0</Opacity>
<ChannelSelection>
<RedChannel>
<SourceChannelName>
<ogc:Function name="env">
<ogc:Literal>B1</ogc:Literal>
<ogc:Literal>1</ogc:Literal>
</ogc:Function>
</SourceChannelName>
<ContrastEnhancement>
<Normalize>
<VendorOption name="algorithm">ClipToMinimumMaximum</VendorOption>
<VendorOption name="minValue">10</VendorOption>
<VendorOption name="maxValue">1227</VendorOption>
</Normalize>
</ContrastEnhancement>
</RedChannel>
<GreenChannel>
<SourceChannelName>
<ogc:Function name="env">
<ogc:Literal>B2</ogc:Literal>
<ogc:Literal>2</ogc:Literal>
</ogc:Function>
</SourceChannelName>
<ContrastEnhancement>
<Normalize>
<VendorOption name="algorithm">ClipToMinimumMaximum</VendorOption>
<VendorOption name="minValue">10</VendorOption>
<VendorOption name="maxValue">1197</VendorOption>
</Normalize>
</ContrastEnhancement>
</GreenChannel>
<BlueChannel>
<SourceChannelName>
<ogc:Function name="env">
<ogc:Literal>B3</ogc:Literal>
<ogc:Literal>3</ogc:Literal>
</ogc:Function>
</SourceChannelName>
<ContrastEnhancement>
<Normalize>
<VendorOption name="algorithm">ClipToMinimumMaximum</VendorOption>
<VendorOption name="minValue">10</VendorOption>
<VendorOption name="maxValue">1162</VendorOption>
</Normalize>
</ContrastEnhancement>
</BlueChannel>
</ChannelSelection>
</RasterSymbolizer>
</sld:Rule>
<sld:VendorOption name="composite">multiply</sld:VendorOption>
</sld:FeatureTypeStyle>
</sld:UserStyle>
</sld:UserLayer>
</sld:StyledLayerDescriptor>