[mapserver-users] Random color

ibrahim saricicek ibrahimsaricicek at gmail.com
Thu Sep 23 01:49:25 EDT 2010


Dear All,

Thanks for your reply. I'm using Postgis. Yes it works and I've used that
kind of function several times.
But what I wonder is a class definition something like that;

 CLASS
   STYLE
     COLOR 'Random'
     ...

On Thu, Sep 23, 2010 at 2:24 AM, Lime, Steve D (DNR) <Steve.Lime at state.mn.us
> wrote:

> 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: mapserver-users-bounces at lists.osgeo.org [
> mapserver-users-bounces at lists.osgeo.org] On Behalf Of Ibrahim Saricicek [
> ibrahimsaricicek at gmail.com]
> Sent: Wednesday, September 22, 2010 7:34 AM
> To: mapserver-users at lists.osgeo.org
> 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
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20100923/3adcd674/attachment.html


More information about the mapserver-users mailing list