[mapserver-users] WMS GetFeatureInfo - is it possible to support multiple INFO_FORMATs?
Trond Michelsen
trondmm-mapserver at crusaders.no
Tue May 10 13:09:46 PDT 2011
On Tue, May 10, 2011 at 04:34:31PM -0300, Jeff McKenna wrote:
>> Is it possible to support multiple INFO_FORMAT properties to a WMS
>> GetFeatureInfo request? That is, is there a way to configure a MAP
>> file that is acting as a WMS Server to return HTML or XML based on
>> what is asked for in the request itself?
> Not that I know of. In fact you should probably check the WMS spec
> on the OGC site to see if that is allowed by the standard (my guess
> is no).
The standard allows multiple mime types for the GetFeatureInfo request:
7.4.3.5 INFO_FORMAT
The mandatory INFO_FORMAT parameter indicates what format to use when
returning the feature information. Supported values for a
GetFeatureInfo request on a WMS server are listed as MIME types in one
or more <Request><FeatureInfo><Format> elements of its service
metadata. The entire MIME type string in <Format> is used as the value
of the INFO_FORMAT parameter. In an HTTP environment, the MIME type
shall be set on the returned object using the Content-type entity
header. If the request specifies a format not supported by the server,
the server shall issue a service exception (code = InvalidFormat).
However, as the example capabilities document shows, the available
mime types for the GetFeatureInfo request is defined on a per-server
basis, and as far as I can tell, all queryable layers must support
all formats.
http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xml
<Capability>
...
<Request>
...
<GetFeatureInfo>
<Format>text/xml</Format>
<Format>text/plain</Format>
<Format>text/html</Format>
<DCPType>
<HTTP>
<Get>
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:type="simple"
xlink:href="http://hostname/path?" />
</Get>
</HTTP>
</DCPType>
</GetFeatureInfo>
</Request>
</Capability>
--
Trond Michelsen
More information about the MapServer-users
mailing list