Is it possible to randomly color polygons?

Jeff Hoffmann jeff at PROPERTYKEY.COM
Thu Apr 12 19:29:25 EDT 2007


I have a layer with a lot of polygons that I want to display, but I 
don't really care about what color those polygons are (they're not 
classified, I'm not going to have a legend, I just want them to be 
different colors so no 2 adjacent polygons are the same color, e.g. 
counties in a state or states in the US).  It seems like it'd be a 
pretty common thing to want, but is there a reasonably easy way to do 
it?  I'm guessing the best way would be to assign a class to each of the 
polygons, but is there some sort of algorithm to figure out how many 
colors I need and how to assign them?

Any ideas?

-- 
Jeff Hoffmann
Head Plate Spinner
PropertyKey.com



More information about the mapserver-users mailing list