Dear All,<br><br>Thanks for your reply. I'm using Postgis. Yes it works and I've used that kind of function several times.<br>But what I wonder is a class definition something like that;<br><br> CLASS<br>
STYLE<br>
COLOR 'Random'<br>
...<br><br><div class="gmail_quote">On Thu, Sep 23, 2010 at 2:24 AM, Lime, Steve D (DNR) <span dir="ltr"><<a href="mailto:Steve.Lime@state.mn.us">Steve.Lime@state.mn.us</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
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:<br>
<br>
LAYER<br>
...<br>
DATA "the_geom from (select *, myColorMaker() as mycolor from myTable)<br>
...<br>
CLASS<br>
STYLE<br>
COLOR [mycolor]<br>
...<br>
END<br>
END<br>
END<br>
<br>
I've not tried anything like this but it should work...<br>
<br>
Steve<br>
<br>
________________________________________<br>
From: <a href="mailto:mapserver-users-bounces@lists.osgeo.org">mapserver-users-bounces@lists.osgeo.org</a> [<a href="mailto:mapserver-users-bounces@lists.osgeo.org">mapserver-users-bounces@lists.osgeo.org</a>] On Behalf Of Ibrahim Saricicek [<a href="mailto:ibrahimsaricicek@gmail.com">ibrahimsaricicek@gmail.com</a>]<br>
Sent: Wednesday, September 22, 2010 7:34 AM<br>
To: <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
Subject: [mapserver-users] Random color<br>
<br>
Hi list,<br>
<br>
Can I define random colors for each of objects in a table?<br>
Or hhould I define classes for each of them?<br>
(I don't want to use Quantum Gis styling and mapserver export.)<br>
<br>
Thanks in advance...<br>
<font color="#888888"><br>
<br>
--<br>
View this message in context: <a href="http://osgeo-org.1803224.n2.nabble.com/Random-color-tp5558894p5558894.html" target="_blank">http://osgeo-org.1803224.n2.nabble.com/Random-color-tp5558894p5558894.html</a><br>
Sent from the Mapserver - User mailing list archive at Nabble.com.<br>
_______________________________________________<br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
<br>
<br>
</font></blockquote></div><br>