You didn't say what environment you're in. If PostGIS I suspect you could write 
a function to generate a random color string (either r g b or #hex) and then 
bind MapServer color values to the function output. The function would simply 
generate 3 random numbers between 1 and 255. In MapServer it'd be:

LAYER
  ...
  DATA "the_geom from (select *, myColorMaker() as mycolor from myTable)
  ...
  CLASS
    STYLE
      COLOR [mycolor]
      ...
    END
  END
END

I've not tried anything like this but it should work...

Steve

________________________________________
From: [email protected] 
[[email protected]] On Behalf Of Ibrahim Saricicek 
[[email protected]]
Sent: Wednesday, September 22, 2010 7:34 AM
To: [email protected]
Subject: [mapserver-users] Random color

Hi list,

Can I define random colors for each of objects in a table?
Or hhould I define classes for each of them?
(I don't want to use Quantum Gis styling and mapserver export.)

Thanks in advance...


--
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/Random-color-tp5558894p5558894.html
Sent from the Mapserver - User mailing list archive at Nabble.com.
_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users


_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to