[mapserver-users] COLOR can take an expression?

Tom Huras tjh at extensys.com
Fri May 16 09:15:39 EDT 2008


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20080516/da3f5524/attachment.html


More information about the mapserver-users mailing list