randomly assigned COLOR 's?

Abe Gillespie abe.gillespie at GMAIL.COM
Fri Apr 21 13:22:15 EDT 2006


Using the EXPRESSION option sounds like a good idea to me.  You can
take it a step further to have dynamic random colors instead of the
static scheme you speak of.  You could import the data into PostGIS. 
Then, you can probably construct a clever SELECT statement that uses
PostgreSQL / PostGIS functions to generate a column containing random
numbers.  Of course it might be tricky to have the random numbers
dynamic on a per session basis.

Good luck.

-Abe

On 4/21/06, Brent Pedersen <bpederse at nature.berkeley.edu> wrote:
> hi,
>
> with a map of the world with country boundaries and
> using only the mapserver CGI, is it possible to have the countries
> filled with one of ~5 different colors. either at random or
> uniformly. is there a way to do this in the mapfile without relying
> on attributes in the shapefile?
>
> my fallback solution will be to add a column in the .shp and assign
> number 1 - 5 to each country and use that in a map file EXPRESSION. i
> thought maybe there was another means i was missing. something like
> an automatic alternating color scheme... to help me do less work.
>
> thanks,
> -brent
>



More information about the mapserver-users mailing list