classes drawing order

Steve Lime steve.lime at DNR.STATE.MN.US
Tue Oct 19 01:18:07 EDT 2004


Classes are indeed drawn as they are encountered. The order of the
classes is significant in that the first expression matched is used for
any given feature. Therefore classes do not have to be mutually
exclusive.

Roads can indeed be tricky to render. Sounds to me like you need to
control the order of the shapes in the shapefile. The last features in
the shapefile are rendered last and you can take advantage of that fact.
For instance you can sort the shapefile based on road type so that
highways are last and therefore show up on top of roads. There is a
sortshp utility included in the MapServer distribution that will allow
you to re-order a shapefile based on an attribute. The other option you
have is to use seperate layers (i.e. draw roads and then draw highways).
You have to step through the file twice, but often that doesn't kill
performance if your data are indexed and perhaps tiled.

Steve

>>> John Bolster <jb at NUCOMP.COM> 10/15/04 10:08 AM >>>
Hi all,

I need to understand the sequence in which different elements are drawn
onto
the map. I understand that layers are drawn from top to bottom in the
mapfile, so a feature in a later layer can overlap a feature in an
earlier
layer, but within one layer, are the classes drawn top down, or as they
are
encountered as mapserv goes through the shapefile?

It's looking like the classes are just drawn as they are encountered,
and
this is producing my problem:

All my roads are drawn with a black circle symbol of, let's say, 5px,
with a
white circle symbol of, let's say, 3px on top. That makes for a nice
outlined road. Let's say my highways are a black circle symbol of 11px
with
a colored circle symbol on top of 9px. So the highways are colored and
have
a black outline.

But where a road intersects with a highway, if the road gets drawn first
it's good because the highway is drawn over the top of it, but if the
highway gets drawn first a little of the white of the road (half a
circle of
it) is drawn out into the intersection, over the top of the highway fill
color.

As it stands, the roads and the highways are both classes of the same
layer.
How do you all overcome this?

Thanks,

John Bolster



More information about the mapserver-users mailing list