[Mapserver-dev] Color Allocations and Control

Frank Warmerdam warmerdam at pobox.com
Wed Feb 18 23:27:49 EST 2004


woodbri at swoodbridge.com wrote:
> Hi all,
> 
> I have run into the changing colors on the map that seems to be 
> caused by running out of color slots. I think this is happening 
> because of antialiasing of truetype fonts.
> 
> I have been working around the problem by defining layers and 
> inserting a dummy feature at the top of the mapfile to reserve the 
> colors, but his is a pain and stupid. So we're now going to create an 
> image in insert it via a dummy layer as it uses less layers, but I 
> have to manage the image file if I make change to my symbology.
> 
> So this got me to thinking that it would make a lot of sense if the 
> mapfile parser made a list of colors explicitly used in the mapfile 
> and pre-allocated them them for me.
> 
> Would this work?
> Can I get someone to do this? I would be happy to test it on some of 
> our mapfiles that have colors getting wacked.


Steve (W),

Steve Lime and I have briefly discussed something like this in the past.
I was thinking a way of predeclaring reserved colors and Steve suggested
that we could actually scan for all the hardcoded colors in various
style objects and so forth and ensure they are reserved before dynamically
allocated colors (for antialiasing) or colors for raster layers.

This whole area has been quite a problem since the 4.0 release.  To some
extent the problem is reduced now with some changes and extra options for
raster layer rendering (the biggest color hogs) but in depending maps
it can still be a problem.

I too think this would be an excellent idea.  Anyone willing to do this?
I would be willing to take a crack at it if no-one else has the time or
inclination.

Some open bug reports related to this issue include:

  http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=397
  http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=306

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-dev mailing list