[mapserver-users] Re: Mapfile multiple CLASSITEM's
Oliver Wesp
oliver.wesp at gmail.com
Mon Aug 9 06:42:04 PDT 2010
Hi,
It's not possible to use more than one field in CLASSITEM but it's is
indeed possible to use more than one field in your expression, so you
don't need CLASSITEM at all.
Say you have to fields ANIMAL and ANIMALSIZE.
CLASS
NAME "SMALL PIG"
EXPRESSION ([ANIMAL] = 'PIG' AND [ANIMALSIZE] = "SMALL")
STYLE
ANGLE 360
COLOR 0 0 0
OUTLINECOLOR 0 0 0
SIZE 10
SYMBOL "YourPointSymbol"
WIDTH 1
END
END
CLASS
NAME "BIG PIG"
EXPRESSION ([ANIMAL] = 'PIG' AND [ANIMALSIZE] = "BIG")
STYLE
ANGLE 360
COLOR 0 0 0
OUTLINECOLOR 100 100 100
SIZE 10
SYMBOL "YourPointSymbol"
WIDTH 1
END
END
You still need more than one class but it does the trick.
Best regards,
Oliver
2010/8/9 Donatas Malinauskas <donatas.malinauskas at lgt.lt>:
> Yes, Sumit, I understand - with few classes I can describe different
> animals, but the problem is that the same PIG in the map should be in
> severel different colours. The column value (eg. big pig - fills white,
> biggest pig - fills yellow, very big pig - fills red and so on) I read from
> data table...Is it possible to fill the same PIG ( in the same class) in
> different colours depending on data column value?
>
> Thanks :)
>
>
> Sumit Sharma [via OSGeo.org] wrote:
>>
>> I use CLASSITEM for only one value, I think you can not use it for
>> multiple values.
>> However for your problem you can easily solve it by using expression in
>> class and color value in style
>> As for your example...
>> CLASS
>> NAME "PIG"
>> EXPRESSION ([ANIMAL] = 'PIG')
>> STYLE
>> ANGLE 360
>> COLOR [ANIMALCOLOR]
>> OUTLINECOLOR 0 0 0
>> SIZE 10
>> SYMBOL "YourPointSymbol"
>> WIDTH 1
>> END
>> END
>> and so on you can make other classes for different "animals"
>> Hope this will resolve your problem
>>
>> View message @
>> http://osgeo-org.1803224.n2.nabble.com/Mapfile-multiple-CLASSITEM-s-tp5388609p5388702.html
>> To unsubscribe from Mapfile multiple CLASSITEM's, click here
>> <http://osgeo-org.1803224.n2.nabble.com/template/NodeServlet.jtp?tpl=unsubscribe_by_code&node=5388609&code=ZG9uYXRhcy5tYWxpbmF1c2thc0BsZ3QubHR8NTM4ODYwOXwyNzc3OTQw>.
>>
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
More information about the MapServer-users
mailing list