Serve raster tiles in GeoServer and renderer them by Leaflet

Steps to handle raster data



Create a raster workspace

Select a store datasource

Create a raster store

Create a layer

Publish review

Layer preview

Layer preview result

Compressed raster layer with only grey band

Exception stack trace 1

Caused by: java.lang.NullPointerException at at at at$1.getProperty( at at at at at org.geotools.image.ImageWorker.getComputedProperty( at org.geotools.image.ImageWorker.getExtremas( at org.geotools.image.ImageWorker.rescaleToBytes( at org.geotools.renderer.lite.gridcoverage2d.RasterSymbolizerHelper.execute( at org.geotools.renderer.lite.gridcoverage2d.RasterSymbolizerHelper.execute( at org.geotools.renderer.lite.gridcoverage2d.StyleVisitorCoverageProcessingNodeAdapter$1.execute( at org.geotools.renderer.lite.gridcoverage2d.BaseCoverageProcessingNode.checkExecuted( at org.geotools.renderer.lite.gridcoverage2d.BaseCoverageProcessingNode.getOutput( ... 124 more

Exception stack trace 2

Caused by: javax.imageio.IIOException: Illegal value for Predictor in TIFF file at it.geosolutions.imageioimpl.plugins.tiff.TIFFLZWDecompressor.<init>( at at ... 166 more

QGIS layer preview

QGIS geotiff layer export

GeoServer layer preview

Cause analysis

Define style in GeoServer

Create style in QGIS

Export style in QGIS

Copy the .qml content

Generate the style template in GeoServer

Specify the style content

Generate .sld in QGIS

Create style in Geoserver from .sld file

Edit layer basic info

Edit WMS Settings

Preview layer

Preview layer when editing style

Add additional styles

Preview layer with additional styles

Enable CORS for GeoServer

Clone repository

Create web.xml

Enable CORS

Docker hub modification

Build and push

./ docker pull hustakin/geoserver

Tomcat error log

Client http

Renderer the raster layer in the web

Leaflet layer using WMS

Leaflet layer using WMTS

OpenLayers layer using WMTS



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store