[mapserver-users] Two questions about WMS and outputformats

Rahkonen Jukka Jukka.Rahkonen at mmmtike.fi
Tue Mar 17 18:02:17 EDT 2009


Hi,

Reason for both of my problems was found.  The first, two image formats that seemed not to work, is caused by not-so-common MIME types "image/png; mode=24bit" and "image/svg+xml" (not "image/tiff" as I wrote in my original mail).  My GIS client does not use url encoding for Space and Plus characters, and therefore GetMap requests are failing.

Another problem comes also from GIS client that is always adding &TRANSPARENT=TRUE to WMS GetMap requests.  GDAL/JPEG driver fails in this case because jpeg really does not support transparency.  GD/JPEG driver does not care but it just cretes a jpeg image for the client.  For WMS users this is more convenient.

-Jukka Rahkonen-



-----Alkuperäinen viesti-----
Lähettäjä: Frank Warmerdam [mailto:warmerdam at pobox.com]
Lähetetty: ma 16.3.2009 18:08
Vastaanottaja: Rahkonen Jukka
Kopio: mapserver-users at lists.osgeo.org
Aihe: Re: [mapserver-users] Two questions about WMS and outputformats
 
Rahkonen Jukka wrote:
> Hi,
> 
> By default, without having any OUTPUTFORMAT sections in the mapfile,
> Mapserver is advertising following imageformats in WMS GetCapabilities
> document:
> 
>  <GetMap>
>       <Format>image/gif</Format>
>       <Format>image/png</Format>
>       <Format>image/png; mode=24bit</Format>
>       <Format>image/jpeg</Format>
>       <Format>image/vnd.wap.wbmp</Format>
>       <Format>image/tiff</Format>
>       <Format>image/svg+xml</Format> 
> 
> Some users have been confused because WMS client builds menu items
> according to that list, but at least "image/png; mode 24bit" and
> "image/tiff" do not give any output. What is the reason to include these
> formats in getCapabilities by default, if they do not work without
> creating OUTPUTFORMATs in the mapfile first?

Jukka,

I don't know why image/tiff and image/png; mode=24bit would not work.
Perhaps you could file a ticket with minimal details to reproduce this
problem.  Please include the mapserv -v string in the ticket so I can
try to reproduce a similar scenario.  Assign the ticket directly to me.

> Second question is about JPEG outputformat. It works through GD with
> these settings
>  OUTPUTFORMAT
>       NAME "jpeg"
>       MIMETYPE "image/jpeg"
>       DRIVER "GD/JPEG"
>       EXTENSION "jpg"
>       IMAGEMODE RGB
>  END
> 
> If I change driver to "GDAL/JPEG" I get this error on ms errorlog
> [Mon Mar 16 11:16:05 2009].825000 msSaveImageGDAL(): General error
> message. Failed to create output JPEG file.
> JPEG driver doesn't support 4 bands.  Must be 1 (grey) or 3 (RGB) bands.
> 
> What makes GDAL/JPEG driver to believe that I want 4 bands? Or is it
> just best to use DG/JPEG always?

I'm surprised.  This should not occur with IMAGEMODE RGB.  I would
appreciate your also filing a ticket on this issue and assigning it to
me.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent






More information about the mapserver-users mailing list