[mapserver-users] Color polygons contd

Steve Lime steve.lime at dnr.state.mn.us
Fri Feb 8 17:51:27 EST 2002


I don't believe there is a mod operator in the expression code. Could be
added, and if you'd care to add that as a bug that would be appreciated.
There is however a workaround using regex, this might work:

CLASSITEM zip
CLASS
  EXPRESSION /[13579]$/   # anything ending in an odd number
  COLOR 255 0 0
END
CLASS
  COLOR 0 0 255   # no need for expression, this becomes the default
END

Steve

Stephen Lime
Data & Applications Manager

Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937

>>> Grant Marblestone <GrantM at ATSER.com> 02/08/02 01:53PM >>>
SO i think the answer to this is to use class expression to get teh
colors
you want.

However i wish to ask further......

For expression not random.. but lets say i have some data zip that is
basically
77777
77788
77478
88983

And i want them to be red if even and blue if odd....
QUESTION
how can i use mod in the expression

EXPRESSION [zip]%2==0 red
EXPRESSION [zip]%2==1 blue?

Thanks,
Grant
----- Original Message -----
From: "Doug Williams" <williams at wildweb.org>
To: <mapserver-users at lists.gis.umn.edu>
Sent: Friday, February 08, 2002 10:32 AM
Subject: [mapserver-users] color polygons?


> Hello,
>
> Is it possible to randomly (or otherwise) color polygons within a
single
> shapefile according to the value of one of the shpefile attributes?
>
> Thanks,
> Doug Williams



More information about the mapserver-users mailing list