[mapserver-users] MINSIZE for POLYGON?
Hankley, Chip
Chip.Hankley at GASAI.Com
Wed Jun 12 14:53:19 PDT 2002
You could still do this (with Area) but define different layers and use the
MAXSCALE and MINSCALE option. So, you would have your small_scale layer,
your medium_scale layer, and your large_scale layer, or however many
different "pyramids" you want, all reading the same data set.
LAYER
NAME LAKE
TYPE POLYGON
MAXSCALE 1000000
MINSCALE 500000
STATUS On
DATA "eu/eu_See"
CLASSITEM 'AREA' #or whatever the fieldname is...
CLASS
EXPRESSION ([AREA] >= 25000) #or whatever your threshold is...
NAME "Lakes"
OUTLINECOLOR 0 0 128
COLOR 209 209 255
END
END
LAYER
NAME LAKE
TYPE POLYGON
MAXSCALE 500000
MINSCALE 50000
STATUS On
DATA "eu/eu_See"
CLASSITEM 'AREA' #or whatever the fieldname is...
CLASS
EXPRESSION ([AREA] >= 10000) #or whatever your threshold is...
NAME "Lakes"
OUTLINECOLOR 0 0 128
COLOR 209 209 255
END
END
... and so on. As long as the layer NAME is the same, passing "&layer=lake"
in the URL will affect ALL of the definitions - so the transition between
these different layers at different scales will be seamless.
Of course the most elegant option would be to use mapscript, then you could
figure out what an "acceptable" size was (say you want no lakes smaller than
10x10 pixels on the map). You could calculate, on the fly, based on your
extent, what this area would be, then dynamically set the value in
EXPRESSION based on your calculation.
Chip
-----Original Message-----
From: Korbai, Zoltan [mailto:korbai.zoltan at axelero.hu]
Sent: Wednesday, June 12, 2002 2:34 PM
To: mapserver-users at lists.gis.umn.edu
Subject: Re: [mapserver-users] MINSIZE for POLYGON?
Thanks to all for the answers. I think the "area" is not the solution
because
the size I mean is the zoomed size. On the map the lakes which are only
some pixels large are similar to dirty pixels. So I only want to show them
when they are zoomed in.
> I think "MINSIZE" only refers to labels and symbols, not layers. Does your
> shapefile have an area field? If so, you could set an expression in your
> class definition to only show polygons whose area was greater than some
> number.
>
> So, your layer definition would be:
>
> LAYER
> NAME LAKE
> TYPE POLYGON
> STATUS On
> DATA "eu/eu_See"
> CLASSITEM 'AREA' #or whatever the fieldname is...
> CLASS
> EXPRESSION ([AREA] >= 3250) #or whatever your threshold is...
> NAME "Lakes"
> OUTLINECOLOR 0 0 128
> COLOR 209 209 255
> END
> END
>
> Chip
More information about the MapServer-users
mailing list