[Chameleon] categorize single polygon layer into different color

Paul Spencer pspencer at dmsolutions.ca
Thu Jun 2 06:41:23 EDT 2005


Rajan,

this is a Map File issue, not a widget issue (and probably should have 
been sent to the mapserver-users list).  The short answer is to add 
CLASSITEM <fieldname> to your LAYER and create multiple CLASS objects. 
In each one, add EXPRESSION "<value>" to have that class apply to that 
value.  There are a great many options for building expressions and for 
styling your layers (using STYLE objects is recommended since MapServer 4.0)

I strongly recommend that you review the excellent documentation on the 
mapserver site for information about classes and styling.

Cheers

Paul

Rajan Man Bajracharya wrote:
> Dear All,
> 
> I am having problem to categories single polygon layer i.e. to change 
> the color depending upon the unique values of the polygon feature. Is it 
> a map file or the widget that needs to be changed.
> 
> e.g. my map file for area zonation polygon layer looks like this
> 
> LAYER
>   GROUP "Vector"
>   NAME area_zonation
>   TYPE POLYGON
>   DATA area_zonation
>   STATUS ON
>   CLASS    # how will this data look?
>     NAME 'area_zonation'
>     TEMPLATE "airports.html"
>     OUTLINECOLOR 128 128 128
>     COLOR 225 225 185
>   END
>   TOLERANCE 5
> END
> 
> Above COLOR tag is the color for whole area_zonation layer. But here I 
> need to change the color depending upon the unique value and change the 
> color of each zone accordingly.
> 
> Any help regarding this would be highly appreciated.
> 
> Regards,
> -rajan
> 
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon
> 

-- 
+-----------------------------------------------------------------+
|Paul Spencer                           pspencer at dmsolutions.ca   |
+-----------------------------------------------------------------+
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/|
+-----------------------------------------------------------------+


More information about the Chameleon mailing list