AW: AW: Re: [mapserver-dev] Ok, one more labeling sample...

Steve Lime Steve.Lime at dnr.state.mn.us
Thu Sep 18 15:37:58 EDT 2008


Ka-map is DHTML layer driven so you're definitely seeing the side
effects of overlaying antialiased, transparent
output on a background. The anti-aliasing occurs on a white background
in the vector map which is why you see
the white artifacts around your text. I'm not sure there is a perfect
fix, variable opacity with 24-bit out put is the
answer but not all browsers support it.

Steve

>>> On 9/18/2008 at 2:17 PM, in message
<19559315.post at talk.nabble.com>, SUSANNE
<susanne.kalliany at tefis.at> wrote:

> The picture is a snap-shot from mapserver display; I am using
Mapserver 5.2
> with ka-map. 
> In my opinion the labels are created with parameters of map-file
laying over
> a common orthofoto with ecw format.
> I helped myself setting a rectangle around the label (BACKGROUNDCOLOR
200
> 200 200); but it would look much better having only tansparent
annotation.
> Thank you, Susanne
> 
> Thank you Steve for your answer:
> 
> How is this picture generated? Looks to me like you're overlaying a
> transparent image over a background image in some other tool. You're
seen
> antialiasing effects then and how/if you can fix them really depends.
You
> should take this question to the main mapserver mailing list or the
mailing
> list for the tool you're doing the overlay in for more discussion.
> 
> Steve
> 
> 
> SUSANNE wrote:
>> 
>> 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
>> 
>> 
>> 
>>  
>> _______________________________________________
>> mapserver-dev mailing list
>> mapserver-dev at lists.osgeo.org 
>> http://lists.osgeo.org/mailman/listinfo/mapserver-dev 
>> 
>> 
> 
> -- 
> View this message in context: 
>
http://www.nabble.com/AW%3A-AW%3A-Re%3A-Ok%2C-one-more-labeling-sample...-tp1

> 9558505p19559315.html
> Sent from the Mapserver - Dev mailing list archive at Nabble.com.
> 
> _______________________________________________
> mapserver-dev mailing list
> mapserver-dev at lists.osgeo.org 
> http://lists.osgeo.org/mailman/listinfo/mapserver-dev


More information about the mapserver-dev mailing list