How do I hide a layer from WMS GETCAPABILITIES XML?

Till Adams adams at TERRESTRIS.DE
Fri Dec 17 01:51:21 PST 2004


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?
>
>
> Windows2000, IIS 5.0
> MapServer version 4.4.0  OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
> SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER INPUT=JPEG
> INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
>
> Thanks!
> Brent Fraser
> GeoAnalytic Inc.
> Tel:(403) 213-2700
> bfraser at geoanalytic.com <mailto:bfraser at geoanalytic.com>
> www.geoanalytic.com <http://www.geoanalytic.com>

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