[mapserver-users] COLOR can take an expression?

Paul Ramsey pramsey at cleverelephant.ca
Fri May 16 13:47:49 EDT 2008


Short answer "no". Your approach is intriguing though :)

You'll find that people can only distinguish between about 5 colors
reliably anyways, so for practical purposes, a five-class color ramp
will do, and is not *that* onerous to build.

P.

On Fri, May 16, 2008 at 6:15 AM, Tom Huras <tjh at extensys.com> wrote:
> I'm learning MapServer so my expectations for what it does may be incorrect.
>
> I want to assign a color to some features from a database based on a
> field.   The full range of values is large, so I don't want to code a CLASS
> for each value.  Instead I'd like to use an expression for the color.
>
> For example, if the attribute of a feature ranges from 0 to 1000, I'd like
> to use it to drive a range of the color green:
>
> LAYER
>   DATA "the_geom from myFeature"
>   CLASSITEM "col1"
>   TYPE LINE
>    ...
>   CLASS
>      NAME "myFeature"
>      STYLE
>         COLOR 0 ([col1] / 1000 * 255) 0
>         WIDTH 1
>      END
>   END
> END
>
> Thanks
>
> /tom
>
> --
> Tom Huras, P.Eng.
> Partner
>
> ExtenSys Inc.
> 31 Plymbridge Cresc                   (416) 481-1546, Mobile (416) 859-1313
> North York, Ontario M2P 1P4    Fax (416) 481-6714, Home Fax (416) 516-7438
> www.extensys.com                      tjh at extensys.com
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>


More information about the mapserver-users mailing list