WMS output formats

Frank Warmerdam warmerdam at POBOX.COM
Thu Nov 10 10:54:21 EST 2005


On 11/10/05, Alexandre Fellay <alexandre.fellay at camptocamp.com> wrote:
> I don't understand some aspects of the behavior of Mapserver (version 4.4.2) as
> WMS server. My problem is as follows :
> I want to publish one single raster layer, and only in jpeg format (all other
> formats being unsuitable for various reasons). So I put in my mapfile
>
> IMAGETYPE jpeg
>
> I add an OUTPUFORMAT object :
>
> OUTPUTFORMAT
>    NAME jpeg
>    DRIVER "GD/JPEG"
>    MIMETYPE "image/jpeg"
>    IMAGEMODE RGB
>    FORMATOPTION QUALITY=88
>    EXTENSION "jpg"
> END
>
> and the required METADATA in my layer :
>    METADATA
>      "wms_title" "blabla"
>      "wms_srs"   "EPSG:21781 EPSG:4326 EPSG:32632"
>      "wms_server_version" "1.1.1"
>      "wms_format" "image/jpeg"
>      "wms_name" "blabla"
>    END
>
> The surprise is in the GetCapabilities answer: other formats are advertised as well
>        <Format>image/jpeg</Format>
>        <Format>image/gif</Format>
>        <Format>image/png</Format>
>        <Format>image/png; mode=24bit</Format>
>        <Format>image/wbmp</Format>
>        <Format>image/tiff</Format>
>
> And, to make things worse, some wms clients (Gaia 2 for example) seem to have a
> png default format, resulting in an ugly 8bit image.
>
> Is it possible to really limit the supported output formats list ?

Alexandre,

This issue has come up from time to time, and Assefa has
done some work to ensure that non-raster formats don't show up.
But there is still no way to prevent default formats from appearing
in the WMS capabilities.

Unfortunately, I'm not sure fixing this would count as
a bug fix, so it might be stuck this way till 5.0.

BTW, as far as I can see the wms_format metadata is not
defined for any purpose on the WEB metadata list.  It does
play a role for WMS layers, determining what format remote
results should be fetched as.

An obvious approach might be to allow the wms_format metadata
item on the WEB object to determine a restricted list of formats
offered via WMS.  I think something similar is already done for
WCS, where you can currently restrict the list of formats offered.

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