[mapserver-users] How to pimp WMS meta information?
Kralidis,Tom [Burlington]
Tom.Kralidis at ec.gc.ca
Thu Sep 25 11:23:09 PDT 2008
> -----Original Message-----
> From: mapserver-users-bounces at lists.osgeo.org
> [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of
> Jochen Topf
> Sent: 25 September, 2008 9:49 AM
> To: Markus Spring
> Cc: Mapserver-users
> Subject: Re: [mapserver-users] How to pimp WMS meta information?
>
> On Tue, Sep 16, 2008 at 07:16:03AM +0200, Markus Spring wrote:
> > trying to set up a multi-map service based WMS mapservices and
> > OpenLayers, I would like to retrieve user-defined meta information
> > from a map via the GetCapabilities request.
> >
> > For example, if I define
> >
> > METADATA
> > WMS_TITLE "Palliativstationen"
> > WMS_ONLINERESOURCE "http://gis.local/wms/palliativ"
> > WMS_SRS "epsg:31468"
> >
> > WMS_SHOW_QUERY_IN "large_popup"
> >
> > END
> >
> > I would like to retrieve the value "large_popup" of
> WMS_SHOW_QUERY_IN
> > through the GetCapabilities call. The background idea is that this
> > information could be used by my application but should not
> harm other
> > people's use of the WMS service.
> >
> > Is there any viable way to accomplish this with a mapserver
> based WMS service?
>
> I have used the WMS keywords on a WMS layer to add special
> infos only needed for my application. Not the cleanest
> approach, because other applications will, of course, also
> see those special keywords you put in, but as a workaround it is ok.
>
> Would be nice if there was an "official" way to do this, though.
>
Out of the box, MapServer will return a well-formed, valid XML document
which obeys the WMS standard.
Having said this, you could use mapscript WxS
(http://mapserver.gis.umn.edu/docs/howto/wxs_mapscript) to, on
GetCapabilities, intercept the request/response mechanism and write out
a modified GetCapbilities XML document, adding in your own XML elements
and definitions, i.e.:
<Layer>
<Name>foo</Name>
<Title>bar</Title>
<MyProperty name="WMS_SHOW_QUERY_IN">large_popup</MyProperty>
...
This would work, with the assumptions that:
1./ a WMS Capabilities parser which is doing DTD checking would choke on
this, as it is not part of the WMS DTD
2./ if there is no DTD checking, the Capabilities will be processed,
only 'aware' clients would know what to do with this info
Of course, if you want to be to-spec 100%, there are ways to extend DTDs
with inline ENTITY's, etc. :)
Hope this helps.
..Tom
More information about the MapServer-users
mailing list