1

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.

enter image description here

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.

  1. Download the full SLD.xml file available in the first link for the Alpha Channel
  2. In GeoServer, go to the Styles page, and Add New Style
  3. 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> ...

  4. Be sure that the correct style is associated with your raster layer.

  5. 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.

1 Answer 1

2

You will get funny artifacts if you use a lossy compression. I'm not really sure what options you get with TileMill, but if you can specifically make PNG tiles, that might sort it out.

I see you note that it seems to be only in GeoServer, so maybe you'll need to work on the raster style to ensure that all the transparent pixels are handled appropriately. I can't help there, though, sorry.

4
  • Thanks for the feedback but, yeah, the tiles are already PNGs. I'll continue to look into the raster style though...
    – mr.adam
    Commented Jan 5, 2015 at 22:47
  • 1
    What about on the GeoServer side? Are you viewing PNGs or JPG?
    – Alex Leith
    Commented Jan 5, 2015 at 22:55
  • Yes, the WMS is PNG, if I'm doing it correctly... the url is xx.xxx.xxx.xxx:8080/geoserver/raster/wms?&format=image/PNG
    – mr.adam
    Commented Jan 6, 2015 at 14:39
  • Nice one working out the solution, maybe share it with us specifically, for posterity!
    – Alex Leith
    Commented Jan 6, 2015 at 21:47

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.