How do I hide a layer from WMS GETCAPABILITIES XML?

Brent Fraser bfraser at GEOANALYTIC.COM
Fri Dec 17 07:52:01 PST 2004


Till,

  Many thanks for the explanation.  I'll have to work through it in detail
to make sure I understand the implications of using SLDs.

  But for the WMS site I'm building, I can't use a solution that involves
client-side code as I expect most of my users will access the site using
ArcMap, MapInfo, and other stand-alone client apps not under my control.
This is supposed to be the great promise of OWS: any server to any client.

  You did give me an idea though (something Ed McNierney had suggested to
solve a different problem): have some server-side ASP return a hand-edited
version of the XML doc when GETCAPABILITIES are requested by the client.
I'll just remove any layers I don't want exposed...

Thanks,
Brent



> Brent Fraser wrote:
>
> > I'm using the new TYPE TILEINDEX layer (pointed to by an
> > indexed raster layer) and I'd like to prevent this layer from being
> > listed in the GETCAPABILITIES XML (and hence listed as a "valid" layer
> > in various WMS clients).
> >
> > Any thoughts?
> > Brent Fraser
>
> Dear Brent,
>
> we have developped a workaround, which is not 100% OGC WMS:
>
> In the mapfile in the expression we have implemented a parameter, e.g.:
>
> CLASS
>  EXPRESSION [index] > %user%
>  COLOR 0 0 0
>  ...
> END
>
>
> So the mapfile does not deliver any map, just a white image. Then we use
> the GetStyle-request to generate a Styled Layer Descriptor  (SLD) from
> the actual mapfile. In this SLD we change the "%user%" in the filter
> with a key on demand, which we assigned to a registered user (this is
> possible in the Mapbender client suite).
> When a registerd user demands a map, the map-request only can send a
> "usable" map, when the correct SLD assigned to the getMap request:
>
> http:// .... &getMap& .... & SLD=URL_to_SLD.xml
>
> The client changes the "%user%" in the XML on demand (pure PHP) with in
> this case "0", so that the filter in the SLD looks like this
>
>  FILTER EXPRESSION [index] > 0
>
> Just some thoughts, may they'll help you ...
>
> Greetings from Bonn, Till



More information about the MapServer-users mailing list