Is it possible to randomly color polygons?

János Gonzales janos.gonzales at GMAIL.COM
Fri Apr 13 13:47:18 EDT 2007


Before you start implementing the Four Color theorem into mapserver
code, I'd recommend taking a look at Quantum GIS (QGIS)  which is a
free open source GIS package that allows you to create map files.
When you import your shapefile to QGIS it is colored randomly  and
then you can export that as a mapfile.

However, i've not been able to run that QGIS function on their latest
windows release.

You might want to look at what other software out there creates
mapfiles on the fly.

Janos

On 4/12/07, Jeff Hoffmann <jeff at propertykey.com> wrote:
> 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