Label Cache Performance

Stephen Woodbridge woodbri at SWOODBRIDGE.COM
Tue Jan 2 10:46:46 EST 2007


HNY All,

Last year I spent a fair amount of time optimizing a bunch of mapfiles 
for performance. One of the areas that seems to always be a performance 
hog if processing the Label Cache. I have been successful are thinning 
down the number of labels going into the cache, but I wondering if there 
might be a more efficient way of dealing with it. Since I have been 
playing with rasters over the holidays I was wondering if it might be 
possible to implement the label cache as a bitmap mask and us a raster 
OP to see if there is a collision?

OK, I'm sure it is possible, I guess my real question(s) are:

Has this approach been looked at before?
Any thoughts on performance?

My idea is:

1) create an label cache image
2) to check a label,
    get its bbox polyon
    check if it overlaps and set pixels
3) polygon fill the bbox of a label into the label cache image
    when a label is rendered

we might be able to use a 2:1 or 4:1 reduced size label cache image with 
some thought about how to work around the issues.

I would think that this would be much faster than searching a list of 
drawn labels and checking for intersections. And it should be linear 
with the number of labels in the cache.

-Steve



More information about the mapserver-dev mailing list