Using Attributes

Ken Lord kenlord at GMAIL.COM
Tue Dec 14 17:06:19 PST 2004


Hi Bob,

Unless things have changed in the last year, you can't do it the way
you want to with shapefiles.  ... I do hope things have changed.

One way to get around it, if you have access to using MapInfo is to
create a MapInfo table containing the data you want to display,
colouring the features using a colour table with Mapinfo.

Then use an OGR connection to display the MapInfo table as a layer in
MapServer and set a STYLEITEM to "AUTO" within the layer definition.

I've done this with regional scale geology polygons over canada, so
that I could be sure the polygons were being coloured using the
standard Geological Survey of Canada colours.  If I had used a
shapefile and coloured the polygons by classes, there would have been
too many classes within the layer for MapServer to handle ... and it
would have taken an unreasonable effort to make all those classes.

In my example it did still take some effort to colour the features in
MapInfo by a colour table given the large dataset. But the end result
has been good.

Cheers,
Ken Lord
Vancouver BC




On Tue, 14 Dec 2004 17:46:17 -0600, Bob Basques
<bob.basques at ci.stpaul.mn.us> wrote:
> All,
>
> I have a SHP file with a "COLOR" column in it with a RGB value (255 255
> 255).
>
> How do I use this in the MAPFILE as a COLOR value?
>
> I've been looking on and off all day in the Wiki, I've come to the
> conclusion that I'm not using the correct Search term.  Does anyone have
> an example of how to use the column attribute value as the color value
> in the MAPFILE?
>
> LAYER
>  NAME 'cities'
>  DATA '<path to data>'
>  STATUS DEFAULT
>  CLASSITEM 'MUNI_NAME'
>  CLASS
>    OUTLINECOLOR 207 50 150
>    COLOR '<value of muni_name column above>'
>    SIZE 2
>    SYMBOL 'circle'
>  END
> END
>
> I think I'm having a brain freeze or something . . . . . mutter, mutter
> . . . .
>
> bobb
>



More information about the MapServer-users mailing list