AW: AW: Re: [mapserver-dev] Ok, one more labeling sample...
DI. Susanne Kalliany
susanne.kalliany at tefis.at
Thu Sep 18 13:59:49 EDT 2008
In my opinion I need outlinecolor for using the polygon as polyline and
hoped not to disturb the label-display. Furthermore my outlinecolor is pink
and not white as the "shadow" around label is showing -picture attached.
Here is the signifanct part of my map-file:
OUTLINECOLOR 255 0 255
Color 0 0 0
Thanks for your reply, Susanne
Von: Steve Lime [mailto:Steve.Lime at dnr.state.mn.us]
Gesendet: Donnerstag, 18. September 2008 16:08
An: susanne.kalliany at tefis.at
Betreff: Re: AW: Re: [mapserver-dev] Ok, one more labeling sample...
Remove the label OUTLINECOLOR, that's all there is to it.
>>> "DI. Susanne Kalliany" <susanne.kalliany at tefis.at> 09/18/08 3:47 AM
Dear Steve and mapserver-community!
I am tracking your labelling discussion with much interest, but my
(small) "problem" is a different one in that context:
How can I get rid of the white "shadows" accompanying all letters ?
In that particular worldmap example they are very useful, but with my
application they are giving a bit a confusing impression.
Any useful hint would be much appreciated, many thanks in advance
Von: mapserver-dev-bounces at lists.osgeo.org
[mailto:mapserver-dev-bounces at lists.osgeo.org] Im Auftrag von Steve Lime
Gesendet: Donnerstag, 18. September 2008 00:43
An: mapserver-dev at lists.osgeo.org
Betreff: [?? Probable Spam] Re: [mapserver-dev] Ok, one more labeling
Here are world countries before and after. Note we can cram on more
with better placement, imagine that...
>>> "Steve Lime" <Steve.Lime at dnr.state.mn.us> 09/17/08 5:37 PM >>>
As I putzed with the polygon label point code I realized that the line
intersection and centering was screwing up some optimal placements based
solely on the center of gravity computation. You really only want to go
that extreme if 1) the CoG is outside the polygon or 2) it's near the
of the polygon. So, I've accounted for those and added a switch that
the label on the either a vertical or horizontal line depending on the
departure from the bbox center point.
Anyway the algorithm looks like so:
1) compute CoG of largest (in terms of area) outer ring
2) if that point falls within the polygon
a) compute shortest distance to polygon
b) if distance is greater than 10% of largest bbox dimension then
c) if not, then point is near an edge go to step 3)
3) intersect a vertical or horizontal line with the polygon and the CoG
find the longest segment, using the mid-point of that segment as the
With the U.S. states shapefile 9 polygons (e.g. FL, LA) are close to the
edge and fall through to step 3. Not sure what the right value is there.
results are quite nice however. I've attached images from this method
the current 5.2 output. Again, I can supply a patch if anyone would like
try it. I'll supply before and after for a few of the test datasets
sent in separate messages.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 47473 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20080918/534630a6/SNAG-000-0001.jpg
More information about the mapserver-dev