[mapserver-users] placement of labels from two different

Stephen Woodbridge woodbri at swoodbridge.com
Fri Apr 6 16:57:30 EDT 2012


You could also try using something like the following, one on each layer:

POSITION CL ALIGN RIGHT OFFSET -5 0
POSITION CR ALIGN LEFT OFFSET 5 0

Obviously set 5 to a value that makes sense for you. Or you can use 
ALIGN CENTER and push the farther apart so the longest lines in each set 
does not interfere with the adjacent label.

The problem with searching for open space is that it is hard and 
computationally expensive. You would be better off precomputing a label 
point and create a separate layer for labeling.

-Steve

On 4/6/2012 2:12 PM, Mark Volz wrote:
> Steve,
>
> Thank you for your comments.  I should have mentioned that I am using
> multi-line labels so using position did not move the label over quite
> enough.  However, I was able to get the label to work by using offset
> which allows me to get the label in closer than when I was using wrap
> to create empty lines to move the label up.
>
>
> I wish there were some better options for label placement such as fit
> a second label inside the largest area of a polygon between current
> labels and the polygon boundary.  This way we could force secondary
> labels to fit within the parcel.  Second, it would also be nice if we
> have a choice to make sure that the labels fit within the bbox, or
> within the polygon boundary. That way we could make sure that labels
> fit within the polygon for illregular shaped parcels such as a soils
> layer. But of course those are unfunded thoughts.
>
>
> Mark Volz GIS Specialist
>
> -----Original Message----- From:
> mapserver-users-bounces at lists.osgeo.org
> [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of
> mapserver-users-request at lists.osgeo.org Sent: Friday, April 06, 2012
> 11:00 AM To: mapserver-users at lists.osgeo.org Subject: mapserver-users
> Digest, Vol 51, Issue 6
>
>
> Message: 5 Date: Fri, 06 Apr 2012 11:35:09 -0400 From: Stephen
> Woodbridge<woodbri at swoodbridge.com> Subject: Re: [mapserver-users]
> placement of labels from two different polygons	that have the same
> feature shape To: mapserver-users at lists.osgeo.org
> Message-ID:<4F7F0D2D.1090703 at swoodbridge.com> Content-Type:
> text/plain; charset=ISO-8859-1; format=flowed
>
> On 4/6/2012 11:07 AM, Mark Volz wrote:
>> Hello, I would like to label both parcel polygons, and lot polygons
>> on my map. Unfortunately, if the parcel and the lot have the exact
>> same boundary, only the parcel is labeled. Does anyone have any
>> ideas or map files on how I could label both parcel polygons and
>> lot polygons? Am I missing a keyword that when the parcel is
>> labeled at the center of the bounding box, a secondary label for
>> the lots could be placed within the open area of the boundary box?
>> I asked this question last year, at the time one person suggested
>> that I could convert my data into points, which has more labeling
>> positions. Unfortunately, I would prefer not to convert my data
>> into points for labeling as I would like to take advantage
>> MINFEATURESIZE AUTO which only works with polygons. P.S. I found
>> that the wrap keyword works so It is possible to label both parcels
>> and lots. However, since extra lines are added the label might fall
>> on top of the wrong lot if I zoom out too far. Thank you Mark Volz
>> GIS Specialist
>
> Mark,
>
> The easiest way to do this is to do something like set the possition
> of one to be UC and the other to be LC. you can also push them
> farther apart by using OFFSET to move the upper one higher and the
> lower one lower.
>
> You might also try POSITION AUTO, but if you use BUFFER this will not
> help.
>
> -Steve W
>
>
> ------------------------------
>
> _______________________________________________ mapserver-users
> mailing list mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>
> End of mapserver-users Digest, Vol 51, Issue 6
> **********************************************
> _______________________________________________ mapserver-users
> mailing list mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users



More information about the mapserver-users mailing list