1

I have a WMTS provided by Geoserver, based on a GeoTIFF. It works fine with the default style ('raster'). With this default style everything's fine (OpenLayers, QGIS). With the purpose to be able to also provide a LegendGraphic i created my own SLD file as a workaround, very much similar to the example in the docs. The SLD is approved 'valid' by Geoserver and i have no problem getting the LegendGraphic via the standard URL.

Now, after adding the WMTS to my OpenLayers Client for some tiles i don't get an image file, but XML with this informati

<?xml version="1.0" encoding="UTF-8"?>
  <ServiceExceptionReport version="1.3.0" xmlns="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/ogc http://myserver:80/geoserver/schemas/wms/1.3.0/exceptions_1_3_0.xsd">   
   <ServiceException> 
     Error rendering coverage on the fast path
     java.lang.IllegalArgumentException: Band number 3 is not valid.
     Band number 3 is not valid.
   </ServiceException>
</ServiceExceptionReport>

The error occurs normally after zooming in some steps, but not only. I wasn't able to identify a pattern. QGIS doesn't display anything at all, after changing the style.

EDIT: The logs:

2018-08-09 09:49:16,607 ERROR [geoserver.ows] - 
org.geoserver.platform.ServiceException: Error rendering coverage on the fast path
at org.geoserver.wms.map.RenderedImageMapOutputFormat.produceMap(RenderedImageMapOutputFormat.java:371)
at org.geoserver.wms.map.RenderedImageMapOutputFormat.produceMap(RenderedImageMapOutputFormat.java:286)
at org.geoserver.wms.map.RenderedImageMapOutputFormat.produceMap(RenderedImageMapOutputFormat.java:141)
at org.geoserver.wms.GetMap.executeInternal(GetMap.java:653)
at org.geoserver.wms.GetMap.run(GetMap.java:285)
at org.geoserver.wms.GetMap.run(GetMap.java:131)
at org.geoserver.wms.DefaultWebMapService.getMap(DefaultWebMapService.java:320)
at sun.reflect.GeneratedMethodAccessor402.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.geoserver.kml.WebMapServiceKmlInterceptor.invoke(WebMapServiceKmlInterceptor.java:38)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.geoserver.gwc.wms.CacheSeedingWebMapService.invoke(CacheSeedingWebMapService.java:62)
at org.geoserver.gwc.wms.CacheSeedingWebMapService.invoke(CacheSeedingWebMapService.java:36)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.geoserver.gwc.wms.CachingWebMapService.invoke(CachingWebMapService.java:87)
at org.geoserver.gwc.wms.CachingWebMapService.invoke(CachingWebMapService.java:55)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.geoserver.ows.util.RequestObjectLogger.invoke(RequestObjectLogger.java:55)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
at com.sun.proxy.$Proxy90.getMap(Unknown Source)
at sun.reflect.GeneratedMethodAccessor257.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.geoserver.ows.Dispatcher.execute(Dispatcher.java:867)
at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:270)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:174)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:50)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
at org.geoserver.filters.ThreadLocalsCleanupFilter.doFilter(ThreadLocalsCleanupFilter.java:28)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:75)
at org.geoserver.wms.animate.AnimatorFilter.doFilter(AnimatorFilter.java:71)
at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:71)
at org.geoserver.filters.SpringDelegatingFilter.doFilter(SpringDelegatingFilter.java:46)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.geoserver.platform.AdvancedDispatchFilter.doFilter(AdvancedDispatchFilter.java:50)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:316)
at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:126)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:90)
at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73)
at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114)
at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73)
at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.geoserver.security.filter.GeoServerAnonymousAuthenticationFilter.doFilter(GeoServerAnonymousAuthenticationFilter.java:54)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:158)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73)
at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
at org.geoserver.security.filter.GeoServerBasicAuthenticationFilter.doFilter(GeoServerBasicAuthenticationFilter.java:84)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:91)
at org.geoserver.security.filter.GeoServerSecurityContextPersistenceFilter$1.doFilter(GeoServerSecurityContextPersistenceFilter.java:53)
at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73)
at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:213)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:176)
at org.geoserver.security.GeoServerSecurityFilterChainProxy.doFilter(GeoServerSecurityFilterChainProxy.java:152)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:88)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.geoserver.filters.XFrameOptionsFilter.doFilter(XFrameOptionsFilter.java:89)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:42)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.geoserver.filters.SessionDebugFilter.doFilter(SessionDebugFilter.java:48)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.geoserver.filters.FlushSafeFilter.doFilter(FlushSafeFilter.java:44)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.eclipse.jetty.servlets.CrossOriginFilter.handle(CrossOriginFilter.java:256)
at org.eclipse.jetty.servlets.CrossOriginFilter.doFilter(CrossOriginFilter.java:219)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:499)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
at java.lang.Thread.run(Thread.java:748)
 Caused by: org.geoserver.platform.ServiceException: java.lang.IllegalArgumentException: Band number 3 is not valid.
at org.geoserver.wms.map.RenderedImageMapOutputFormat.directRasterRender(RenderedImageMapOutputFormat.java:1127)
at org.geoserver.wms.map.RenderedImageMapOutputFormat.produceMap(RenderedImageMapOutputFormat.java:369)
... 117 more
 Caused by: java.lang.IllegalArgumentException: Band number 3 is not valid.
at org.geotools.renderer.lite.gridcoverage2d.ColorMapNode.visit(ColorMapNode.java:148)
at org.geotools.renderer.lite.gridcoverage2d.RasterSymbolizerHelper.visit(RasterSymbolizerHelper.java:251)
at org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer.symbolize(GridCoverageRenderer.java:475)
at org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer.renderImage(GridCoverageRenderer.java:1004)
at org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer.renderImage(GridCoverageRenderer.java:815)
at org.geoserver.wms.map.RenderedImageMapOutputFormat.directRasterRender(RenderedImageMapOutputFormat.java:1015)
... 118 more

EDIT2: gdalinfo

Driver: GTiff/GeoTIFF
Files: file.tiff                                                                                                                                
   file.tfw                                                                                                                                 
Size is 3601, 1801                                                                                                                                           
Coordinate System is:                                                                                                                                        
GEOGCS["WGS 84",                                                                                                                                             
DATUM["WGS_1984",
    SPHEROID["WGS 84",6378137,298.257223560493,
        AUTHORITY["EPSG","7030"]],
    AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4326"]]
Origin = (-180.050000000000011,90.050000000000011)
Pixel Size = (0.100000000000000,-0.100000000000000)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
COMPRESSION=LZW
INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (-180.0500000,  90.0500000) (180d 3' 0.00"W, 90d 3' 0.00"N)
Lower Left  (-180.0500000, -90.0500000) (180d 3' 0.00"W, 90d 3' 0.00"S)
Upper Right ( 180.0500000,  90.0500000) (180d 3' 0.00"E, 90d 3' 0.00"N)
Lower Right ( 180.0500000, -90.0500000) (180d 3' 0.00"E, 90d 3' 0.00"S)
Center      (   0.0000000,   0.0000000) (  0d 0' 0.01"E,  0d 0' 0.01"N)
Band 1 Block=3601x32 Type=Byte, ColorInterp=Red
Band 2 Block=3601x32 Type=Byte, ColorInterp=Green
Band 3 Block=3601x32 Type=Byte, ColorInterp=Blue

EDIT3: SLD-file:

 <?xml version="1.0" encoding="UTF-8"?>
 <StyledLayerDescriptor xmlns=... version="1.0.0">
 <UserLayer>
  <Name>elevation</Name>
 <LayerFeatureConstraints>
  <FeatureTypeConstraint/>
 </LayerFeatureConstraints>
 <UserStyle>
  <Name>elevation</Name>
  <Title>elevation</Title>
  <Abstract>coming soon</Abstract>
  <FeatureTypeStyle>
    <Rule>
      <RasterSymbolizer>
        <Opacity>1.0</Opacity>
        <OverlapBehavior>
          <AVERAGE/>
        </OverlapBehavior>
        <ColorMap type="interval">
          <ColorMapEntry color="#000000" quantity="1" opacity="1.0" label="-8000 m"/>
          <ColorMapEntry color="#000519" quantity="1" opacity="1.0" label="-7000 m"/>
          <ColorMapEntry color="#000a32" quantity="1" opacity="1.0" label="-6000 m"/>
          <ColorMapEntry color="#00507d" quantity="1" opacity="1.0" label="-5000 m"/>
          <ColorMapEntry color="#0096c8" quantity="1" opacity="1.0" label="-4000 m"/>
          <ColorMapEntry color="#56c5b8" quantity="1" opacity="1.0" label="-3000 m"/>
          <ColorMapEntry color="#acf5a8" quantity="1" opacity="1.0" label="-2000 m"/>
          <ColorMapEntry color="#d3fad3" quantity="1" opacity="1.0" label="-1000 m"/>
          <ColorMapEntry color="#faffff" quantity="1" opacity="1.0" label="0 m"/>
          <ColorMapEntry color="#008c00" quantity="1" opacity="1.0" label="600 m"/>
          <ColorMapEntry color="#ffff00" quantity="1" opacity="1.0" label="1000 m"/>
          <ColorMapEntry color="#cc0000" quantity="1" opacity="1.0" label="3500 m"/>
          <ColorMapEntry color="#ffffff" quantity="1" opacity="1.0" label="5000 m"/>
          <ColorMapEntry color="#e1e1e1" quantity="1" opacity="1.0" label="6000 m"/>
          <ColorMapEntry color="#d4d4d4" quantity="1" opacity="1.0" label="7000 m"/>
          <ColorMapEntry color="#0a0a0a" quantity="1" opacity="1.0" label="8000 m"/>
          <ColorMapEntry color="#000000" quantity="1" opacity="1.0" label="9000 m"/>
        </ColorMap>
      </RasterSymbolizer>
    </Rule>
  </FeatureTypeStyle>
</UserStyle>
</UserLayer>

4
  • please look in the log file and add the actual error message to the question
    – Ian Turton
    Aug 8, 2018 at 22:02
  • Of course, the logs. Here it is. You might need to know what the "118 more" are. Unfortunately i didn't succeed to ask geoserver for this information. At least not using the "verbose logging profile".
    – user52883
    Aug 9, 2018 at 9:56
  • OK so the issue is that band 3 is invalid (or missing) - so we need to see gdalinfo output for your tiff and the sld file that you are using to style it
    – Ian Turton
    Aug 10, 2018 at 9:39
  • added both gdalinfo and sld-file
    – user52883
    Aug 10, 2018 at 13:44

1 Answer 1

1

What you try to do is not possible with your GeoTiff file.
The file has no elevation values, instead is already a rendered three band RGB image.

Each band has only 8bit (=Byte) meaning 2^8 or 256 values per Band, but you try to add a ColorMap which is usually used only for single Band raster files with values from -8000 to +9000 which are not valid with your file.

1
  • Thank you, RoVo! What i initially didn't understand was that some tiles were successfully loaded from the server (not in the browser cache). But probably the reason was that GeoWebCache still had stored these tiles rendered with the default style, right? That means i have to look for another workaround to get my LegendGraphic.
    – user52883
    Aug 11, 2018 at 14:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.