Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Fixed
    • Affects versions: 16.3
    • Fix versions: 18.0
    • Labels:
      None

      Description

      I have a setup with an ImageMosaic based on single banded geotiffs, that are combined into a 4-banded layer, using coverage views.
      I get an exception (see below) because the color model is null. I guess the renderer should not assume that a color model is set.
      Using this SLD:

      <?xml version="1.0" encoding="ISO-8859-1"?>
      <StyledLayerDescriptor version="1.0.0" 
       xsi:schemaLocation="http://www.opengis.net/sld 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>PROBAV_color_raster</Name>
          <UserStyle>
          <!-- Styles can have names, titles and abstracts -->
            <Title>Default Raster</Title>
            <Abstract>A style which renders a false colour composite of the Sentinel 2.  </Abstract>   
           
            <FeatureTypeStyle>
              
      
              <Rule>
                <Name>Default rule</Name>
                <Title>Opaque Raster</Title>
                <Abstract>A raster with 100% opacity</Abstract>
                <RasterSymbolizer>
                  
                  <Opacity>1.0</Opacity>
                   <ChannelSelection>
                    <RedChannel>
                      <SourceChannelName>3</SourceChannelName>
                    </RedChannel>
                    <GreenChannel>
                      <SourceChannelName>2</SourceChannelName>
                    </GreenChannel>
                    <BlueChannel>
                      <SourceChannelName>1</SourceChannelName>
                    </BlueChannel>
                  </ChannelSelection>
                  <ContrastEnhancement>
        <Normalize>
         <VendorOption name="algorithm">StretchToMinimumMaximum</VendorOption>
         <VendorOption name="minValue">0</VendorOption>
         <VendorOption name="maxValue">2000</VendorOption>
        </Normalize>
      </ContrastEnhancement>
                </RasterSymbolizer>
              </Rule>
            </FeatureTypeStyle>
          </UserStyle>
        </NamedLayer>
      </StyledLayerDescriptor>
      
      java.lang.NullPointerException
              at org.geotools.resources.image.ColorUtilities.getNumBands(ColorUtilities.java:409)
              at org.geotools.coverage.TypeMap.getColorInterpretation(TypeMap.java:513)
              at org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer.affine(GridCoverageRenderer.java:664)
              at org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer.symbolize(GridCoverageRenderer.java:465)
              at org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer.renderImage(GridCoverageRenderer.java:962)
              at org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer.paint(GridCoverageRenderer.java:1190)
              at org.geotools.renderer.lite.StreamingRenderer$RenderCoverageReaderRequest.execute(StreamingRenderer.java:3465)
              at org.geotools.renderer.lite.StreamingRenderer$PainterThread.run(StreamingRenderer.java:3554)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
              at java.lang.Thread.run(Thread.java:748)
      2017-07-07 19:45:24,773 ERROR [org.geotools.rendering] -
      java.lang.NullPointerException
              at org.geotools.resources.image.ColorUtilities.getNumBands(ColorUtilities.java:409)
              at org.geotools.coverage.TypeMap.getColorInterpretation(TypeMap.java:513)
              at org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer.affine(GridCoverageRenderer.java:664)
              at org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer.symbolize(GridCoverageRenderer.java:465)
              at org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer.renderImage(GridCoverageRenderer.java:962)
              at org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer.paint(GridCoverageRenderer.java:1190)
              at org.geotools.renderer.lite.StreamingRenderer$RenderCoverageReaderRequest.execute(StreamingRenderer.java:3465)
              at org.geotools.renderer.lite.StreamingRenderer$PainterThread.run(StreamingRenderer.java:3554)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jeroen.dries Jeroen Dries
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: