[mapserver-users] trying new label positioning - no change

2009-02-17 Thread William Kyngesburye
I'm trying the new label positioning improvements for polygons in  
trunk from


http://trac.osgeo.org/mapserver/ticket/606

but AUTO seems to be ignoring the initial CC in the new ordering -  
with no collisions with other labels, all polygons are labelled at the  
UL corner of the polygon center.


Are there special conditions for AUTO/CC to work?  A typical label I'm  
trying is:


LABEL
  COLOR 0 100 222
  SHADOWCOLOR 218 218 218
  SHADOWSIZE 1 1
  OUTLINECOLOR 255 255 255
  TYPE TRUETYPE
  FONT helvetica-italic
  SIZE 9
  POSITION AUTO
  WRAP '|'
  PRIORITY 5
  MINFEATURESIZE 16
END

AUTO:

inline: Picture-1.png



POSITION CC does work to label polys at CC:

inline: Picture-2.png



PS. the new gravity positioning is nice!


-
William Kyngesburye kyngchaos*at*kyngchaos*dot*com
http://www.kyngchaos.com/

Earth: Mostly harmless

- revised entry in the HitchHiker's Guide to the Galaxy


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] trying new label positioning - no change

2009-02-17 Thread Steve Lime
William: In my testing a polygon layer is definitely starting at position CC.  
Any chance
you're using an annotation layer here? I have found an issue if that's the 
case. The decision
to using one set of positions vs another is made based on the layer type NOT 
the geometry
type. So annotation layers are treated as point layers regardless of the source 
geometry. As
the code sits now that information is lost. Wasn't an issue previously since we 
didn't vary
things. I'll file a bug on this issue.

Let me know if this isn't the case for you.

One work around is to ditch annotation layers for polygons. They really aren't 
necessary with
the addition of the label priority support in 5.0.

Steve 

 William Kyngesburye wokl...@kyngchaos.com 02/17/09 2:55 PM 
(Sorry, OSX mail habit, the images would be inline next to appropriate  
text descriptions)

The first is POSITION AUTO.  Not what I was expecting.

The second is POSITION CC.  What I was expecting for AUTO, now.

On Feb 17, 2009, at 2:29 PM, Steve Lime wrote:

 So what are pictures 1  2 representing? There's certainly a  
 difference and I would have expected
 picture 2 to represent the new labeling with CC as the first choice.

 Steve

 On 2/17/2009 at 12:42 PM, in message
 7da25c07-8345-491d-b082-b268ee480...@kyngchaos.com, William  
 Kyngesburye
 wokl...@kyngchaos.com wrote:
 I'm trying the new label positioning improvements for polygons in
 trunk from

 http://trac.osgeo.org/mapserver/ticket/606

 but AUTO seems to be ignoring the initial CC in the new ordering -
 with no collisions with other labels, all polygons are labelled at  
 the
 UL corner of the polygon center.


-
William Kyngesburye kyngchaos*at*kyngchaos*dot*com
http://www.kyngchaos.com/

The equator is so long, it could encircle the earth completely once.

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] trying new label positioning - no change

2009-02-17 Thread William Kyngesburye

On Feb 17, 2009, at 11:02 PM, Steve Lime wrote:

William: In my testing a polygon layer is definitely starting at  
position CC.  Any chance
you're using an annotation layer here? I have found an issue if  
that's the case. The decision
to using one set of positions vs another is made based on the layer  
type NOT the geometry
type. So annotation layers are treated as point layers regardless of  
the source geometry. As
the code sits now that information is lost. Wasn't an issue  
previously since we didn't vary

things. I'll file a bug on this issue.

Let me know if this isn't the case for you.


O.  I've always used annotation layers for feature annotation.   
But, if it always treats annotation layers as point layers, why does  
ANGLE FOLLOW work on annotation layers of line features, or gravity  
positioning on annotation of poly features?  Or does that trigger  
stepping out of the assumed-point default somehow?


I did notice when poking around in the source that the labelling  
routines didn't know about the geometry of individual features.  In my  
own early (v4.4) attempts at reordering the positions for polys  
(before the recent changes) I added a parameter to the addlabel()  
functions to pass the shapetype.


One work around is to ditch annotation layers for polygons. They  
really aren't necessary with

the addition of the label priority support in 5.0.



I'm not sure what you mean here - how does label priority invalidate  
annotation layers?


-
William Kyngesburye kyngchaos*at*kyngchaos*dot*com
http://www.kyngchaos.com/

Oh, look, I seem to have fallen down a deep, dark hole.  Now what  
does that remind me of?  Ah, yes - life.


- Marvin


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] trying new label positioning - no change

2009-02-17 Thread Steve Lime
Comments inline...

 William Kyngesburye wokl...@kyngchaos.com 02/17/09 11:34 PM 
 On Feb 17, 2009, at 11:02 PM, Steve Lime wrote:

 William: In my testing a polygon layer is definitely starting at  
 position CC.  Any chance
 you're using an annotation layer here? I have found an issue if  
 that's the case. The decision
 to using one set of positions vs another is made based on the layer  
 type NOT the geometry
 type. So annotation layers are treated as point layers regardless of  
 the source geometry. As
 the code sits now that information is lost. Wasn't an issue  
 previously since we didn't vary
 things. I'll file a bug on this issue.

 Let me know if this isn't the case for you.

 O.  I've always used annotation layers for feature annotation.   
 But, if it always treats annotation layers as point layers, why does  
 ANGLE FOLLOW work on annotation layers of line features, or gravity  
 positioning on annotation of poly features?  Or does that trigger  
 stepping out of the assumed-point default somehow?

A shapes geometry is used when deciding where to compute a label point.
In this case the we're deciding on what the acceptable position array is and
that's done when processing the cache, long after the label points original
geometry has been destroyed.

 I did notice when poking around in the source that the labelling  
 routines didn't know about the geometry of individual features.  In my  
 own early (v4.4) attempts at reordering the positions for polys  
 (before the recent changes) I added a parameter to the addlabel()  
 functions to pass the shapetype.

I think I'd just pass a shapeObj pointer to the msAddLabel() and harvest
what is necessary: type and a few indexes.

 One work around is to ditch annotation layers for polygons. They  
 really aren't necessary with the addition of the label priority support in 
 5.0.

 I'm not sure what you mean here - how does label priority invalidate  
 annotation layers?

The principle reason to use annotation layers was to control the order in
which labels are stuffed into the cache. They were especially useful with
polygons since you typically draw those first but if you want to emphasize
labels then you'd have to use annotation to make the labels show before
other stuff.

Label priorities fix that. You can give a polygon layer high priority labels
without having to resort to annotation layers later in the mapfile. The benefits
(besides working around this bug) are two-fold:

  1) performance, you only have to process the polygon features once...
  2) brevity, shorter, more concise layer definitions are good...

Certainly annotation layers are still useful but principally for things like
copyright notices or road shields.

Steve
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] trying new label positioning - no change

2009-02-17 Thread William Kyngesburye

On Feb 18, 2009, at 12:15 AM, Steve Lime wrote:


I did notice when poking around in the source that the labelling
routines didn't know about the geometry of individual features.  In  
my

own early (v4.4) attempts at reordering the positions for polys
(before the recent changes) I added a parameter to the addlabel()
functions to pass the shapetype.


I think I'd just pass a shapeObj pointer to the msAddLabel() and  
harvest

what is necessary: type and a few indexes.


If you think this is something that can be done, it would be nice have  
geometry and annotation layers both use the same positioning rules  
based on the geometry type (see comments below).



I'm not sure what you mean here - how does label priority invalidate
annotation layers?


The principle reason to use annotation layers was to control the  
order in
which labels are stuffed into the cache. They were especially useful  
with
polygons since you typically draw those first but if you want to  
emphasize
labels then you'd have to use annotation to make the labels show  
before

other stuff.

Label priorities fix that. You can give a polygon layer high  
priority labels
without having to resort to annotation layers later in the mapfile.  
The benefits

(besides working around this bug) are two-fold:

 1) performance, you only have to process the polygon features once...
 2) brevity, shorter, more concise layer definitions are good...

Certainly annotation layers are still useful but principally for  
things like

copyright notices or road shields.

Steve



Hmm, but mixing the annotations with their geometry in a single layer  
means you can't turn geometry and annotations on and off separately -  
I often want to show just the feature geometry, yet be able to turn on  
their annotations if I need it.


Also, what about the drawing order?  Won't other feature layers then  
draw on top of earlier feature layers and annotations of those  
layers?  Or does the label cache force ALL annotations to draw last,  
no matter what layer they're on?


I guess I need a visual diagram of the [now many] various possible  
combinations of layer types, annotations, priorities and layer  
ordering to make sense of this.


-
William Kyngesburye kyngchaos*at*kyngchaos*dot*com
http://www.kyngchaos.com/

Time is an illusion - lunchtime doubly so.

- Ford Prefect


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users