Non-clipped polygon annotation

Steve Lime Steve.Lime at DNR.STATE.MN.US
Mon Dec 17 19:51:10 EST 2007

Cool! I was planning on doing this myself. I even had it working but I inadvertently deleted
that branch doing some house keeping and haven't had time to recreate. Couple of comments:

 - I'd go with an easier to understand processing key, perhaps LABEL_PRE_CLIP?
 - there are 2 places to apply this (for polygons), for ANNOTATION layers and for POLYGON layers
 - should be implemented for LINE layers as well

For some reason I remember being able to do this without doing a shape copy. I believe I intervened 
before clipping and generated the label point and then referenced that point if a flag was set.
Basically msPolygonLabelPoint() was run before the clip (if the processing key was set) and
then not afterwards (or vice versa). I think you'd get better performance avoiding the copy.


>>> On 12/17/2007 at 6:22 PM, in message <476712C7.7010403 at>,
project10 <project10 at PROJECT10.NET> wrote:
> Hi devs,
> I've implemented support for an item that was discussed on IRC last week 
> - annotating polygons based on their pre-clip shape. This gives fixed 
> label positioning for polygon layers without the need to precompute an 
> annotation point based on the polygon centroid.
> Frank suggested that I commit my ideas to a proper RFC format, but I 
> wanted to first get some feedback from you guys.
> The patch adds support for a NOCLIPANNO processing directive at the 
> layer level. If the processing option is enabled, it will copy the 
> polygon shape pre-clip and use that to determine annotation points. If 
> not given, the old behavior is used.
> My initial implementation is at 
> Some renders showing the behavior change:
> - current behavior
> - Why I didn't like the 
> current behavior. My labels get 'dragged around'.
> - Labeling of a polygon with 
> my change
> - If the map is panned, the 
> annotation point stays fixed, even though part of the shape it annotates 
> is now clipped.
> - It also plays nice with 
> partials.

More information about the mapserver-dev mailing list