[Mapserver-users] raster legend

Frank Warmerdam warmerdam at pobox.com
Fri May 30 16:35:19 EDT 2003


Matt Doggett wrote:
> Has anyone successfully rendered a legend for the classes in a raster
> layer?
> 
>  As an example, I have a GRASS raster that contains a small number of
> cell values (e.g. 0=none, 1=few, 2=many, 3=much, etc.) rendered from
> GDAL and it displays in colors from red to green. But for the legend
> icon there is just a blank white box. What I'd like is a colored box for
> each category in the raster.

Matt,

I think you will need to define a CLASS by hand for each value you want to
appear in the legend.  Were you hoping it would be automatically initialized
from the color table (and perhaps class names?) available in GRASS?  I could
in theory implement a kind of "AUTO" class generation for raster sources that
have color tables *and* class names but that doesn't exist at this time.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent





More information about the mapserver-users mailing list