[Mapserver-users] classifying raster maps with more than 50 classes

Frank Warmerdam warmerdam at pobox.com
Tue Apr 29 11:16:01 EDT 2003


Jan Hartmann wrote:
> Hello list,
> 
> I'm trying to display some world gridded data (elevation, population, 
> satellite) with user defined color ramps. All data are resampled to 
> GeoTiff rasters with 256 values and a colormap. The colors are adequate 
> for initial display, but I would like to give the user the option to 
> choose between different predefined color maps (greyscale, equalized, 
> different color panels). In Grass this is very simple: just adapt the 
> color table. With MapServer I am able to create classes for the colors I 
> need, but this is limited to a total of 50 and I have the impression 
> that evaluating so many class-expressions is not very fast. Is there a 
> possibility to adapt the colormap in a GDAL file directly before 
> rendering it? It doesn't have to be within MapServer; a command line 
> utility would be usable too.  I just don't want to duplicate the raster 
> file for every color scheme I need.

Jan,

First I would note that evaluating alot of classes for a raster layer isn't
really too expensive.  All raster values between 0 and 255 are evaluated
against the class list and the first match is used.  So with 255 classes
there would be roughly 32K comparisons but that is still not a huge number.
It isn't as if every pixel is classified separately.

That said, I could imagine it being useful to be able to provide override
colortables via a PROCESSING option of some kind.  Huge numbers of classes
are verbose and a bit expensive to process just to represent 256 entry
color tables.

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