[mapserver-dev] Label Position Auto change?

Lime, Steve D (DNR) Steve.Lime at state.mn.us
Mon Feb 27 09:24:56 EST 2012


I think for the primary issue discussed in this thread a processing directive would probably be best. Since the position array is layer type based we could allocate those once at the head of msDrawLabelCache() for each layer. It's just more bookkeeping.

Steve

________________________________________
From: Stephen Woodbridge [woodbri at swoodbridge.com]
Sent: Friday, February 24, 2012 5:11 PM
To: Lime, Steve D (DNR)
Cc: mapserver-dev
Subject: Re: [mapserver-dev] Label Position Auto change?

Ok, great minds think alike :)

I inadvertently set POSITION CC on an annotation layer and then spent
1/2 hour trying to figure out why my symbols disappeared. I hate when I
do that!

Anyway, thanks for pointing out the ticket, I added myself to the CC.
This would be very nice to add to the other label enhancements that are
getting done, but sounds like it will have to wait.

Thanks,
   -Steve W

On 2/24/2012 5:32 PM, Lime, Steve D (DNR) wrote:
> The label cache code doesn't use CC if labeling points or polygons w/styles. Probably needs tweaking given label style support. Here's the current logic:
>
> if(layerPtr->type == MS_LAYER_POLYGON || (layerPtr->type == MS_LAYER_ANNOTATION&&  cachePtr->shapetype == MS_SHAPE_POLYGON&&  cachePtr->numstyles == 0)) {
>    positions[0]=MS_CC; positions[1]=MS_UC; positions[2]=MS_LC; positions[3]=MS_CL; positions[4]=MS_CR;
>    npositions = 5;
> } else if(layerPtr->type == MS_LAYER_LINE || (layerPtr->type == MS_LAYER_ANNOTATION&&  cachePtr->shapetype == MS_SHAPE_LINE&&  cachePtr->numstyles == 0)) {
>    positions[0]=MS_UC; positions[1]=MS_LC; positions[2]=MS_CC;
>    npositions = 3;
> } else {
>    positions[0]=MS_UL; positions[1]=MS_LR; positions[2]=MS_UR; positions[3]=MS_LL; positions[4]=MS_CR; positions[5]=MS_CL; positions[6]=MS_UC; positions[7]=MS_LC;
>    npositions = 8;
> }
>
> There's already a ticket (http://trac.osgeo.org/mapserver/ticket/2981) although I have no immediate plans to fix it...
>
> Steve
>
> -----Original Message-----
> From: mapserver-dev-bounces at lists.osgeo.org [mailto:mapserver-dev-bounces at lists.osgeo.org] On Behalf Of Stephen Woodbridge
> Sent: Friday, February 24, 2012 4:21 PM
> To: mapserver-dev
> Subject: [mapserver-dev] Label Position Auto change?
>
> Hi Thomas, Steve L,
>
> Would it be easy to change the labeling to either change the order of
> POSITION AUTO or to add a PROCESSING directive or some other mechanism
> to change the order.
>
> For example when labeling cities, I think it would look better if we
> followed an order like:
>
> Upper center
> Lower center
> Center right
> Center left
> Upper right
> Upper left
> Lower right
> Lower left
> Center center - this is bad if you have a symbol because it falls over
> the symbol, so I can see optionally leaving it out of the list.
>
> Obviously, not everyone will have this preference so some flexibility in
> defining the order would make sense.
>
> Another idea would be to do something like:
>
> POSITION "UC LC CR CL UR UL LR LL"  # to specify the order (note no CC)
>
> This would make it easy to pass the same via a binding.
>
> Does anyone have any thoughts on this? Cartography, technical, other?
>
> I will create an enhancement ticket and summarize this thread in it.
>
> Thanks,
>     -Steve W
> _______________________________________________
> 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