Help on tiger, again.
Stephen Woodbridge
woodbri at SWOODBRIDGE.COM
Wed Mar 2 06:01:12 PST 2005
Hermawan,
Sorry, you didn't post your mapfile last time so I didn't have the whole
picture. CLASSes are like a CASE statement in software and you need a
selector (aka: EXPRESSION) and then some cases (aka: CLASS), then the
first CLASS the gets executed stops evaluation of additional CLASSes for
that object.
So currently, you have no CLASSITEM and no EXPRESSION lines so mapserver
is happy to draw your lines with the first CLASS it encounters.
You will need to identify an attribute field that allows you to
differentiate streets from highways in the Tiger data. This is typically
done with the Tiger CFCC field, (I hope your data has this). Assuming it
does them you need to set "CLASSITEM 'CFCC'" in the layer and set
'EXPRESSION "A[123]"' in the CLASS for "highway". Since class order is
important, you need the "highway" first, then the "Michigan Roads"
without an EXPRESSION which will make if the default catch all class.
-Steve
Hermawan Sutantio wrote:
> Is there an identifier for 'highways' in the roads layer that I seem to be
> missing? I inserted those piece of code as shown below, but the highways
> are
> still drawn in black with size 1. Thanks.
>
> Herman
>
> LAYER
> NAME "Michigan"
> TYPE LINE
> STATUS DEFAULT
> TILEINDEX "C:\ms4w\apps\gmap\htdocs\michigan\roads-tile"
> MAXSCALE 50000
> CLASS
> NAME "Michigan Roads"
> COLOR 0 0 0
> SIZE 1
> END
> CLASS
> NAME "highway"
> COLOR 255 0 0 # make it red
> SYMBOL 0 # this is a built in circle symbol
> SIZE 5 # make it 5 pixels wide
> # if you want it fancy then add also
> OVERLAYSYMBOL 0
> OVERLAYCOLOR 255 255 255 # add a white down the center of the red
> OVERLAYSIZE 1
> END
>
>
>
>>>>
> Yes, you can specify thickness like this:
>
> CLASS
> NAME "highway"
> COLOR 255 0 0 # make it red
> SYMBOL 0 # this is a built in circle symbol
> SIZE 5 # make it 5 pixels wide
> # if you want it fancy then add also
> OVERLAYSYMBOL 0
> OVERLAYCOLOR 255 255 255 # add a white down the center of the red
> OVERLAYSIZE 1
> END
>
> You can also do this by adding multiple STYLE ... END blocks instead of
> using OVERLAY* where each STYLE is draw in turn to make a more complex
> styling of the line.
>
> -Steve
>
> Herman Teo wrote:
>
>> Hi there.
>> I have been working on tiger files for a while now. I manage to get the
>> feature labels working right now. I'm just wondering, in roads layer, are
>> there ways to make highways stand out in front of the normal roads,
>> such as
>> giving them thicker red lines?
>> Thanks again for all your help.
>>
>> Herman Teo
>>
>
More information about the MapServer-users
mailing list