Geoserver allows to proxy WMS GetMap and GetFeatureInfo Requests to other WMS-Servers. Overall this works reliably and great.
However, I'm having trouble with a new service I'm integrating. No matter what I do, resulting PNG's always have a white background instead of transparent. The exact same Request pointed directly at the MapXtreme WMS Service works as it should, meaning the resulting PNG is transparent.
Everything is configured as it should, as far as I know. Moreover, it is configured exactly the same as an other working WMS (I don't know which technology is used there).
The thing that stood out for me in the log file was the BgColor parmeter:
2018-03-22 09:22:51,878 INFO [geoserver.wms] - Request: getServiceInfo 2018-03-22 09:22:51,880 DEBUG [geoserver.ows] - Getting layers and styles from LAYERS and STYLES 2018-03-22 09:22:51,880 DEBUG [geoserver.ows] - establishing null style for myws:mylayer 2018-03-22 09:22:51,881 DEBUG [geoserver.wms] - setting up map 2018-03-22 09:22:51,881 DEBUG [wms.map] - setting up 256x256 image 2018-03-22 09:22:52,326 INFO [geoserver.wms] - Request: getMap Angle = 0.0 BaseUrl = http://my.wms.server:80/ Bbox = SRSEnvelope[2717396.2137828125 : 2722683.5524514774, 1248403.6496270949 : 1255733.3898753526] BgColor = java.awt.Color[r=255,g=255,b=255]
What did I miss, why am I not getting transparent PNG's?
WMS Parameters are the following, sent to both services. One is transparent, one isn't:
SERVICE: WMS VERSION: 1.1.1 REQUEST: GetMap FORMAT: image/png TRANSPARENT: true STYLES: LAYERS: my_layer SRS: EPSG:2056 WIDTH: 256 HEIGHT: 256 BBOX: 2718121,1248957,2723408,1256286
URL encoded as:
My colleague found out, MapXtreme produces RGB PNGs with NoData values instead of RGBA. Geoserver can not work with these, thus producing a PNG with a white background. There are some issues in GeoWebCache related to this. We are currently working to get this fixed in Geoserver. The other, easier option would be to configure MapXtreme WMS to produce the right output format for PNG. If this is at all possible, and if so, how?