Discussion:
Mapfile multiple CLASSITEM's
Donatas Malinauskas
15 years ago
Permalink
HHi,

Is it possible to use multiple classitem's in mapserver mapfile? I want
to symbolize my point by two column values (make symbol by one column
value and make that symbol color by other column value).

eg. symbol - pig (found by classitem and expression = 'pig') and she can
be red, black, white... it depends on second column value...How can I
symbolize it?

Maybe it's possible to do in other way?

Thanks,
Donatas.
Sumit Sharma
15 years ago
Permalink
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 this message in context: http://osgeo-org.1803224.n2.nabble.com/Mapfile-multiple-CLASSITEM-s-tp5388609p5388702.html
Sent from the Mapserver - User mailing list archive at Nabble.com.
Donatas Malinauskas
15 years ago
Permalink
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
15 years ago
Permalink
As I understand your problem, you may have two cols in your data base, say,
Animal and AnimalColor. In that case you can use before said class
definition where you will set expression as EXPRESSION ([ANIMAL] = 'PIG')
and color of that animal in style object as COLOR [ANIMALCOLOR]
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Mapfile-multiple-CLASSITEM-s-tp5388609p5388832.html
Sent from the Mapserver - User mailing list archive at Nabble.com.
Oliver Wesp
15 years ago
Permalink
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
...
donats
15 years ago
Permalink
Thanks friends for advices everything is working now :) Appreciate your
help!
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Mapfile-multiple-CLASSITEM-s-tp5388609p5391797.html
Sent from the Mapserver - User mailing list archive at Nabble.com.
Loading...