[mapserver-users] GetCapabilities for a specific layer, not the entire mapfile?

John Maurer maurerj at nsidc.org
Thu Apr 17 11:08:10 EDT 2008


Thanks, Guillaume! I've decided to implement a small slant on what you 
suggested. I'm going to modify my CGI to look for a "layers=layer_name" 
parameter as part of an otherwise normal GetCapabilities request, as in:

mapserver.pl?service=WMS&request=GetCapabilities&layers=layer_name1,layer_name2

But otherwise it will do as you suggest: strip the specified layer(s) 
from the larger GetCapabilities request and pass this along to the end 
user so that only these layers are presented. I wish that the WMS spec 
had provided this capability to begin with! Maybe a good idea for the 
next release from OGC (1.1.2?)...

Thanks again!

Cheers,
John Maurer
http://nsidc.org/data/atlas/

Guillaume Sueur wrote:
> Your very welcome !
>
> I can send you my own proxy function in Python if you want
>
> regards,
>
> Guillaume
>
> John Maurer a écrit :
>> Hi Guillaume,
>> Thank you for your suggestion. I still think it's unfortunate there 
>> isn't something built into the existing OGC specifications to handle 
>> this sort of thing. I'm weighing my various options still and will 
>> see what's best. Your suggestion seems like the most straightforward 
>> to implement so far. I appreciate you spending the time to e-mail me!
>> Cheers,
>> John Maurer
>>
>> Guillaume Sueur wrote:
>>> Hi John,
>>>
>>> Maybe you can also filter the getCapabilities on the server side : 
>>> make a wrapper which will get called by the client (for instance : 
>>> www.server.net/myOwnCapabilities?layer=layer_name&map=map.map
>>>
>>> the wrapper will perform the standard getCapabilities on 
>>> http://localhost/cgi-bin/mapserv and then manipulate the XML doc to 
>>> erase all the layers nodes not requested by the user.
>>>
>>> If it suits your need, you can go this way.
>>>
>>> Hope that helps
>>>
>>> Guillaume
>>>
>>> John Maurer a écrit :
>>>> Hi mapserver-users,
>>>> What is the best way to provide a generic/flexible WMS-related URL 
>>>> for a specific layer within my MapServer mapfile? I want to include 
>>>> this kind of thing in our DIF & FGDC metadata so that users know 
>>>> about a WMS for a given data set. If I provide a GetCapabilities 
>>>> request, this advertises *all* of the layers in my mapfile, which 
>>>> represent a collection of multiple data sets, most of which will be 
>>>> unrelated to the data set in the metadata. On the other hand, if I 
>>>> provide a GetMap request this allows me to specify the layer 
>>>> intended for a particular data set, but it limits the output 
>>>> possibilities to a specific srs, format, width, height, and bbox. A 
>>>> GetCapabilities for a specific layer would be akin to what I need, 
>>>> but I don't think that's how it works. This is my quandary and I'm 
>>>> hoping somebody has a solution to this kind of thing??
>>>> Thanks!
>>>> Cheers,
>>>> John Maurer
>>>>
>>>
>>
>

-- 
John Maurer
Web/Database Applications Engineer
National Snow and Ice Data Center (NSIDC)
University of Colorado at Boulder
http://cires.colorado.edu/~maurerj
------------------------------------
"Without geography, you're nowhere!"




More information about the mapserver-users mailing list