I'm having trouble with removing white background/bounding box from raster in Geoserver. When I add WMS service in ArcMap or Autocad I'm seeing this white bounding box and to be fair I don't know how to remove it.

Here is example:

enter image description here

I even tried changing SLD styles in Geoserver but without any luck. Here is my .xml style:

<?xml version="1.0" ?>
<sld:StyledLayerDescriptor version="1.0.0" xmlns="http://www.opengis.net/sld" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:sld="http://www.opengis.net/sld">

Image is in TIFF format with 3 bands. Is it problem in style format, image itself or Geoserver? Or is it even possible to host raster images without white bounding box as seen in picture above? Any advice? :)


OK, I've finally figure it out. I had to install GDAL and used following command to remove white border (bounding box) GDAL command:

D:\FOLDER_NAME\RASTERS>gdalwarp -dstalpha -srcnodata 256 -dstnodata 0 input.tif output.tif

input.tif is the name of the raster (eg. county_roads.tif)and output.tif is name of the raster after command (eg.county_roads_GDAL.tif)

Here are results, hope it helps: enter image description here

Must say, installing GDAL on WIN OS is real pain in the ...

| improve this answer | |

In the settings (in the layer page), try setting "output transparent color" to white

| improve this answer | |
  • 1
    you meant InputTransparentColor under subheader Coverage Parameters? if you do, I already tried that :( – Svinjica Dec 8 '16 at 20:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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