I'm running across an issue with the display of some historic line maps that I'm trying to serve as a WMS with GeoServer.
I have created a mosaic of georeferenced line drawings in ArcMap, and I want to serve it with a transparent background. I put the single mosaic .tif in TileMill (dev version) and styled it there using the raster colorizer to only show values from 0 to 150 (the black/dark greys). This produces a perfect black line drawing with a transparent background that looks great over an aerial. I then export to a .mbtiles file and serve that through GeoServer using the Mbtiles plugin.
The main problem is that when viewing the WMS in ArcMap, "white noise" is visible around the lines, which is not in TileMill. I unpacked the .mbtiles file with mb-util and the lines are clean there, so it seems to come from GeoServer somewhere.
I've tried modifying the color band details in the layer settings, but am not having any luck.
I think the problem was just with the default raster style in GeoServer, so I was able to create a new style and upload it to achieve exactly what I was looking for. All is well!
I'm still refining the SLD that I will use for this, but I'm basically using the Alpha Channel effect that is described here. Also, you can select which band to use as described here.
- Download the full SLD.xml file available in the first link for the Alpha Channel
- In GeoServer, go to the Styles page, and Add New Style
Upload the document, and you'll then be able to edit it. I ended up with something simple like:
... <RasterSymbolizer> <ChannelSelection> <GrayChannel> <SourceChannelName>4</SourceChannelName> </GrayChannel> </ChannelSelection> <ColorMap> <ColorMapEntry color="#000" quantity="175" opacity="0" /> <ColorMapEntry color="#000" quantity="255" /> </ColorMap> </RasterSymbolizer> ...
Be sure that the correct style is associated with your raster layer.
- What's really nice about this method is that you can load the WMS in ArcMap/QGIS (or any webmap) and any changes to the stylesheet in GeoServer are immediately reflected in the WMS.