Question about OFFSET values

Blammo bob.basques at CI.STPAUL.MN.US
Sat Dec 10 10:41:58 EST 2005


Stephen,

I won't be able to get back to it again  till Monday.

There seems to be a few different possible approaches to this.

I'm not so sure it needs to be thought of as a bug as of yet.  It really 
is a specialized labelling need at the moment. Not surehow many other 
might need to do something like this, at least very often. Your 
suggestion below might be an alternative that could work too.  Although 
I like the finer control of the OFFSET parameter which is a pixel level 
vs a character spacing.

One problem I know I'm not going to avoid is when a curved street 
segment is encountered.  While these types of lines are in the minority 
of the dataset, they won't label correctly if I push the labels out to 
the ends of the line because all the positioning of the labels will be 
dependent on the central sub-line element of the multipart line 
segment.  This is why I've settled on the more central line labels.  The 
readability problem comes into play when the line segment being labelled 
is on the short side and the labels start to overlay the nearby labels 
of other line segments.

Since I have all these labels so close to each other, all the label 
interference parameters seem to do is turn everything off if they are 
used.  I'm still testing on this stuff though.  One thought would be the 
possible addition of a parameter to stop labelling a line below a 
certain (sub-) segment length, but there's a possibility that some 
segments might never get labelled no matter how far you zoom in.

To tell the truth, this is really related more to wrapping labelling 
around a curve, which I know has been mentioned in the past as a desired 
option.   Adding this capability in though seems to be a bit harder to 
accomplish than fiddling with the current settings to get something 
close, which I've done already, see below

LABEL
  ANGLE AUTO
  POSITION LL
  TEXT "[L_FROM]"
    OFFSET 10 5  ## it's interesting that these numbers don't need to be 
negative like I thought at first.
  ...
END
LABEL
  ANGLE AUTO
  POSITION UL
  TEXT "[L_TO]"
    OFFSET 10 5
  ...
END
LABEL
  ANGLE AUTO
  POSITION LR
  TEXT "[R_FROM]"
    OFFSET 10 5
  ...
END
LABEL
  ANGLE AUTO
  POSITION UR
  TEXT "[R_TO]"
    OFFSET 10 5
  ...
END

bobb

Stephen Woodbridge wrote:

> Hi Bob,
>
> Would you post what you have done so far? I have wanted to do 
> something like this for a long while.
>
> Have you, would you open a bug for an enhancement to mapserver to 
> better support this functionality?
>
> You might be able to get this to work with two layers by:
>
> LABEL
>   ANGLE AUTO
>   POSITION CC
>   TEXT "[L_FROM] [R_FROM]"
>   WRAP " "
>   ...
> END
>
> Then you can vary the number of spaces between the two fields based on 
> the line thickness and then use the OFFSETs to get them positioned on 
> the line.
>
> It would be nice if POSITION could take a percentage along the line 
> segment as the label point. So 0.0 would be the start of the line and 
> 1.0 would be the end of the line and the angle would be based on which 
> part of the polyline that the label point fell on.
>
> -Steve W.
>
> Bob Basques wrote:
>
>> All,
>>
>> Ok, I got my addressing range labels too llok pretty good using four 
>> Layers with seperate LABELITEMS and OFFSETS.
>>
>> Now I need to figure out a way, if possible, to scale the OFFSET 
>> values based on the overall length of the line.
>>
>> Can I use a value, line length, and a percentage of line length to 
>> use for the Offset values of the labels.  Right now the labels are 
>> situated for the most part near the center of the line.  I would like 
>> to puch the labels out to the ends of the lines for example, or pull 
>> them in closer for longer and shorter line segments.
>>
>> This is purely an exercise in readability right now, what I have 
>> seems to be working great for the customer.  Thanks for the pointers 
>> I got last week.
>>
>> bobb
>>
>
>



More information about the mapserver-users mailing list