[mapserver-users] Mapserver 6.2.1 fails to read remote WMS in png format

Daniel Morissette dmorissette at mapgears.com
Thu Apr 25 06:43:56 PDT 2013


Hi Jukka,

IIRC, a few releases ago (not sure if that was in 6.0 or before) we got 
rid of all native raster reading code in MapServer and started relying 
solely on GDAL for raster input. i.e. before that we used to read PNG 
input directly in MapServer code using libpng, and now we do it through 
GDAL. That could possibly explain why you get different behaviors, but 
doesn't explain why your PNG cannot be read by GDAL.

Two things to check:

1- Does the image/png request captured from the logs work from the 
server machine (using wget for instance)? Does it return a valid PNG image?

2- Save the output of that request with a command such as "wget 
https://... -O /tmp/test.png" and try running gdalinfo on the output. 
Maybe that will give some hints.

Daniel


On 13-04-25 8:05 AM, Rahkonen Jukka wrote:
> Hi,
>
> I was testing Mapserver 6.2.1 from the MS4W 3.0.1beta-1 installation and thought that there was something wrong with the connection.  However, the problem seems to be in Mapserver side.  I have been using &FORMAT=image/png for reading the remote WMS with Mapserver 6.0.1 but with MS 6.2.1 it does not work.  After changing  image format into image/jpeg Mapserver can again cascade the remote WMS.
>
> Part of the errorlog is in the attachment but the most relevant parts are here
>
> This request with FORMAT=image/jpeg works
>
> [Thu Apr 25 14:30:24 2013].970000 HTTP request: id=1, https://...&FORMAT=image/jpeg&STYLES=&HEIGHT=353&VERSION=1.1.1&SRS=EPSG:3067&WIDTH=459&BBOX=406810.908602495,7216210.70370872,407078.361045337,7216416.39153513&TRANSPARENT=TRUE&EXCEPTIONS=application/vnd.ogc.se_inimage
> ....................
>   [Thu Apr 25 14:30:27 2013].354000 msDrawRasterLayerGDAL(): red,green,blue,alpha bands = 1,2,3,0
> [Thu Apr 25 14:30:27 2013].372000 msDrawMap(): Layer 1 (test), 0.022s
> [Thu Apr 25 14:30:27 2013].372000 msDrawMap(): Drawing Label Cache, 0.000s
> [Thu Apr 25 14:30:27 2013].372000 msDrawMap() total time: 2.408s
> [Thu Apr 25 14:30:27 2013].590000 msSaveImage(stdout) total time: 0.218s
> [Thu Apr 25 14:30:27 2013].592000 mapserv request processing time (msLoadMap not incl.): 2.629s
>
> This request with FORMAT=image/png does not work
>
> [Thu Apr 25 14:31:13 2013].915000 HTTP request: id=1, https://...&FORMAT=image/png&STYLES=&HEIGHT=353&VERSION=1.1.1&SRS=EPSG:3067&WIDTH=459&BBOX=406508.434778249,7215858.43375314,407593.615379665,7216693.00619824&TRANSPARENT=TRUE&EXCEPTIONS=application/vnd.ogc.se_inimage
> .........................
> [Thu Apr 25 14:31:18 2013].349000 msDrawRasterLayerGDAL(): red,green,blue,alpha bands = 1,0,0,0
> [Thu Apr 25 14:31:18 2013].349000 drawGDAL(): Unable to access file. GDALDatasetRasterIO() failed: GetBlockRef failed at X block offset 0, Y block offset 0
> [Thu Apr 25 14:31:18 2013].349000 msDrawMap(): WMS connection error. Failed to draw WMS layer named 'test'. This most likely happened because the remote WMS server returned an invalid image, and XML exception or another unexpected result in response to the GetMap request. Also check and make sure that the layer's connection URL is valid.
> [Thu Apr 25 14:31:18 2013].349000 mapserv request processing time (msLoadMap not incl.): 4.441s
>
>
> It looks like GDAL cannot find correct bands from the png output of the remote WMS: " msDrawRasterLayerGDAL(): red,green,blue,alpha bands = 1,0,0,0". However, Mapserver 6.0.1 with GDAL 1.8 can cascade this service fine and all my WMS clients work well with the remote WMS by using image/png format.  I made also another test by trying to cascade our own Mapserver 6.0.1 and the result was the same:  if I read data as image/png remote WMS I get the  "GDALDatasetRasterIO() failed" error.
>
> I am not sure if this is Mapserver, GDAL or MS4W bug. Any opinions?
>
> -Jukka Rahkonen-
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>


-- 
Daniel Morissette
http://www.mapgears.com/
Provider of Professional MapServer Support since 2000



More information about the mapserver-users mailing list