Using different shapefiles for different zoom levels

Trond Michelsen trondmm-mapserver at CRUSADERS.NO
Fri Jun 2 10:52:01 EDT 2006


Hi.

What's the preferred way of switching data sources as you zoom in in
mapserver?

I have three different sets of shapefiles (2M:1, 250k:1 and 50k:1) and
I want to show more details as you zoom in.

At the moment, I'm using GROUP and MAX/MINSCALE to get mapserver to
use the correct data. Something like this:

LAYER
    NAME "roads-2M"
    GROUP "roads"
    DATA 2M/roads
    STATUS on
    TYPE vector
    MINSCALE 500000
...
END
LAYER
    NAME "roads-250k"
    GROUP "roads"
    DATA 250k/roads
    STATUS on
    TYPE vector
    MAXSCALE 500000
    MINSCALE 100000
...
END
LAYER
    NAME "roads-50k"
    GROUP "roads"
    DATA 50k/roads
    STATUS on
    TYPE vector
    MAXSCALE 100000
...
END

This works as intended, so I'm pretty much happy with the
solution. But, all four layers (roads, roads-2M, roads-250k and
roads-50k) are displayed in the GetCapabilities- response, and I'd
prefer if only "roads" was made available. I also get the feeling that
I'm "cheating" here. My impression is that GROUP is intended to create
a "bundle" of relevant layers, so if the group is "roads", relevant
group members would be "highways" and "local roads".

So - is there any other/better way of accomplishing this, or is this
it?

-- 
Trond Michelsen



More information about the mapserver-users mailing list