[Chameleon] categorize single polygon layer into different color

Paul Spencer pspencer at dmsolutions.ca
Fri Jun 3 06:19:56 EDT 2005


Rajan,

can you also send your legend template file please?

Paul

Rajan Man Bajracharya wrote:
> Dear Paul,
> 
> Sorry to bother you once again. Though my previous problem have been 
> solved to display with different color in a map but legend is not 
> working accordingly. I have define NAME [string] i.e. the name to use in 
> legends for this class in my map file.  But after defining it,legend is 
> not showing for separate classes. I tried using LEGEND tag for each 
> CLASS but I think it's not the correct way to do.
> 
> Do I need to make changes in legendtemplate widget?
> 
> Also,   METADATA
>             SHOWINLEGEND "nope"
>          END
> is not working at my end.
> 
> LAYER
>   ...
>   CLASSITEM "AREA_COD_1"
>   CLASS # how will this data look?
>     EXPRESSION /1|6/
>     NAME 'area_code1'
>     OUTLINECOLOR 128 128 128
>     COLOR 225 225 185
>     TEXT "TEST"
>     LABEL
>       MINFEATURESIZE 40
>       MINDISTANCE 150
>       POSITION CC
>       SIZE TINY
>       COLOR 0 0 0
>     END
>   END
> 
>   CLASS
>     EXPRESSION /2|7/
>     NAME 'area_code2'
>     OUTLINECOLOR 128 128 128
>     COLOR 225 185 225
>         STYLE
>                 COLOR 255 0 0
>         END
>   END
> 
> and so on ...
> 
> At 06:41 AM 6/2/2005 -0400, you wrote:
> 
>> 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/|
>> +-----------------------------------------------------------------+
> 
> 
> 

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


More information about the Chameleon mailing list