[Mapserver-users] colouring problems

Frank Warmerdam warmerdam at pobox.com
Tue Dec 9 15:34:21 EST 2003


Bart van den Eijnden wrote:
> Hi list,
> 
> we are having some colouring issues with Mapserver on for example ECW 
> files. These colouring issues only occur with raster layers that most of 
> the time represent topographical maps.
> Sometimes white is getting almost pink/purple in some of the 
> topographical maps.
> 
> I have attached 2 small images (sorry for anyone who does not want 
> attachments at this mailing list) illustrating the problem.
> 
> Does anybody know how to solve this colouring issue?

Bart,

Without inspecting the .ecw files, the map file and so forth it is hard to
be sure what is happening.  However, I would guess that the "blank" areas
in the ECW are some a grey however by the point the ECW layer is rendered
there are very few (or no) colors left available for allocation.  So it
has to use the existing colors.  I would guess the ECW grey varies a bit,
and in the areas that show pink that was the closest color, and the other
areas the white was the closest.

Assuming you don't want to switch to 24bit output, I would suggest the
best approach is to "trick" MapServer into allocating some colors that
are good for the ECW file.  In particular, add an early layer with a
color that is approximately the grey appearing in the ECW background.

I haven't played around with tricking mapserver into allocating colors
without actually drawing anything.  It might be sufficient to have a
vector layer with classes for each color you want to force allocate, but
the corresponding shapefile empty so nothing gets rendered.

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