[Mapserver-users] Problem with colours when displaying a GEOTiff image along with vector layers

Frank Warmerdam warmerdam at pobox.com
Wed Oct 15 09:55:01 EDT 2003


Covariance wrote:
> Ed:
> 	thank you very much, it worked like a charm. I wonder why this
> problem only started in this latest version of the MapServer? - just
> curious.

Bob,

This changed with 4.0 because the manner of handling color allocation changed
substantially.  Colors are now (mostly) allocated as they are needed, and if
your base layer is a raster it can grab most of the colors.  In the past colors
were allocated as the file was parsed.  The new approach is good in that
unneeded colors don't get allocated, but bad in that the common case of a
greyscale baselayer can soak up all the colors.

To correct this, the development version of MapServer in CVS (4.1?) will only
use 128 levels of grey for greyscale rasters.  Also, I think Steve is working
on ways to pre-allocate some colors when scaning the mapfile.  I am not sure
of the details of this work.

So, hopefully, MapServer 4.1 will be less problematic than 4.0 has been in
this regard.  Of course the color thresholding Ed mentions is gives you
excellent control, and should continue to work.  In the past it has been my
opinion that 32 levels of grey are plenty for most purposes.  To limit the
colors to 32 levels you should be able to set the COLOR_MATCH_THRESHOLD to 8
or so.

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