Implementing Scale-Dependent Styles in a WMS Server
Jim Klassen
Jim.Klassen at CI.STPAUL.MN.US
Thu Jul 26 07:59:43 PDT 2007
If I understand your setup, you are in charge of two mapserver installs,
one being a WMS server and another acting as a WMS client.
I don't know what this will do to the getCapabilities response (and it
doesn't matter if Mapserver is your only client), but you could in the
WMS servers map file try adding a GROUP 'mygroup' statement to each of
your layers, thus assigning each of the layers to the same group. Each
of the layers can then be setup with the correct styles and min/max
scales.
Then try calling the WMS service and ask it for the 'mygroup' layer.
We do something similar here internally with our aerial orthos, except
we have one mapfile per logical layer and just set status=default in all
of the layers in the mapfile so they will always be rendered, no matter
which one the client chooses. (The min/max scales are setup so only one
layer from the mapfile will be active at any given scale.)
>>> Bill Thoen <bthoen at GISNET.COM> 07/26/07 9:41 AM >>>
I'm starting to build a MapServer WMS server that will provide national
street layers to my MapServer client but I have some questions about how
to approach the problem of serving alternate layers designed for
different scales and same layers with different styles depending on the
scale. For example, I've got a US Interstates layer that has been
thinned so that it is appropriate for scales smaller than 1:10,000,000,
and I've got another one that I'd use at larger scales (but from
1:10,000,000 to 1:5,000,000 I want to use one style and for scales
between 1:5,000,000 and 1:1,000,000 I want to use another style on this
layer). Then I've got some MapInfo seamless road layers that have the
highest detail that I'd use at the largest scales, but for these too, I
have three different styles depending on the display scale.
Can a MapServer WMS server support this sort of thing or should I load
each layer as needed and style it in the WMS client MAP file? I know how
to do the latter, but it would be much more convenient to make one call
to a WMS and get all the appropriate layers rendered with the desired
styles in one LAYER call in my client MAP files. I've read the how-tos
for WMS client and server, and glanced at the article about SLD's (but
haven't understood that very well yet) but so far I haven't seen this
issue addressed specifically. Does anyone have any suggestions about
how to do this, or can you point me to any documentation I should read?
TIA,
- Bill Thoen
More information about the MapServer-users
mailing list