[mapserver-users] Still impossible to force labels inside their polygons?

Mark Volz MarkVolz at co.lyon.mn.us
Tue Sep 4 11:15:40 PDT 2012


Hello,

I think many users would be able to take advantage of being able to force labels inside polygons.  At the same time I realize that the current "bounding box" algorithm is fast.   My question is could both be possible?


Scenario One:  It would be fastest to use a bounding box to creating labels for a polygon that has a rectangular shape such as a section or township.  
LABEL   
	....
	MINFEATURESIZE AUTO
END 


Scenario Two:  Force labels to fit inside a polygon to avoiding ambiguity is more important than speed, such as a soils layer.  A ForceLabelInside (or a better keyword) will tell Mapserver to use a slower algorithm to help place the label inside the polygon.  This slower, but better placed algorithm might also be used for layers that are cached.
LABEL
	....
	MINFEATURESIZE AUTO
	ForceLabeInside YES  #  Possibilities NO (current and default), YES (force label inside), ?
END 


Thanks

Mark Volz
GIS Specialist


 
> It's tough to know what I'm looking at from the picture. What does the layer
> definition look like?
> 
> At the moment polygon label point computation tries a couple of approaches
> get a label point inside the polygon: 1) compute a center of gravity 2) if that
> computation doesn't work (e.g. point is too close to the edge) then a
> scanline-based process is used to sample possible positions. The mid-point of
> the longest y sample is used.
> 
> It's always trade-off with speed and the above seems a happy medium.
> 
> Steve


More information about the mapserver-users mailing list