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


Dear Steve!

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:

LAYER
   NAME Kataster_region
   GROUP Kataster
   STATUS OFF
   MAXSCALE 300000
   TYPE POLYGON
   DATA 'd:/ewald/Kataster_OOE/45416GST'
   LABELITEM 'GNR'
   CLASS
      STYLE
         OUTLINECOLOR 255 0 255
         WIDTH 1
      END
      LABEL
         TYPE TRUETYPE
         FONT 'sans'
         SIZE 8
         POSITION cc
         Color 0 0 0
      END
   END
   TEMPLATE 'dummy.html'
END

Thanks for your reply, Susanne

-----Ursprüngliche Nachricht-----
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.

Steve

>>> "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
current
(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

Susanne

-----Ursprüngliche Nachricht-----
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
sample...

Here are world countries before and after. Note we can cram on more
labels
with better placement, imagine that...

Steve

>>> "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
to
that extreme if 1) the CoG is outside the polygon or 2) it's near the
edge
of the polygon. So, I've accounted for those and added a switch that
centers
the label on the either a vertical or horizontal line depending on the
CoG
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
quit,
your done
  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
and
find the longest segment, using the mid-point of that segment as the
label
point

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.
The
results are quite nice however. I've attached images from this method
and
the current 5.2 output. Again, I can supply a patch if anyone would like
to
try it. I'll supply before and after for a few of the test datasets
folks
sent in separate messages.

Steve


-------------- next part --------------
A non-text attachment was scrubbed...
Name: SNAG-000.jpg
Type: image/jpeg
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 mailing list