Hi,
wanted to bring up a question about text symbolizers and
vendor options.
In text symbolizers the label placement defines how a label
is to be drawn.
The PointPlacement, default if no placement is set, has to
place the label in the "middle" of the geometry, with horizontal
orientation (unless a rotation is supplied of course).
The LinePlacement works only with lines and asks the label
to be placed "along the line", without specifying if
tangent or curved. The curved bit is added by the VendorOption
followLine.
Now, what poeple are getting confused about is that they expect
the labels to be curved and follow lines by just specifying
the vendor option, without asking for a LinePlacement.
Which really means, they think the vendor option fully overrides
the placement definition. In a text symbolizer there is no
difference between telling no placement or explicitly asking
for a point placement, as that is the default.
At the moment when mixing point placement and curved labels
some (the really curved ones) are drawn along the line,
others (the one that end up being straight anyways) are
drawn horizonally. It's a bug. The problem is, where?
Option 1: the code should just ignore the vendor option
in that case, as no line placement was asked for to
start with
Option 2: the code should throw an exception telling
the user to make a decision, point placement or following
the lines?
Option 3: the code should take the vendor option as
an override and forget about the point placement, even
if it was specified explicitly (the code that draws
the labels has no way to tell if the placement was
asked explicitly or just defaulted).
I like option 2. What other people think?
Cheers
Andrea
--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.
I like option 1.
If you forget to specify point placement yet also specify
"followLine", then you have messed up your SLD in my opinion. Most
likely a copy-paste error.
Now what could be handy is a combination of 1+2. It will ignore the
vendor option, but give you a warning that your SLD is a little mixed
up and some options were ignored. That will help trace down problems
with the SLD.
As SLD files can become unwieldy very quickly, anything to help clean
them up or make them more understandable will be good.
Of course an SLD editor would be great too and would solve these
problems =) But that is definitely not an easy task.
--
Brent Owens
On Tue, Sep 15, 2009 at 10:01 AM, Andrea Aime <aaime@anonymised.com> wrote:
Hi,
wanted to bring up a question about text symbolizers and
vendor options.
In text symbolizers the label placement defines how a label
is to be drawn.
The PointPlacement, default if no placement is set, has to
place the label in the "middle" of the geometry, with horizontal
orientation (unless a rotation is supplied of course).
The LinePlacement works only with lines and asks the label
to be placed "along the line", without specifying if
tangent or curved. The curved bit is added by the VendorOption
followLine.
Now, what poeple are getting confused about is that they expect
the labels to be curved and follow lines by just specifying
the vendor option, without asking for a LinePlacement.
Which really means, they think the vendor option fully overrides
the placement definition. In a text symbolizer there is no
difference between telling no placement or explicitly asking
for a point placement, as that is the default.
At the moment when mixing point placement and curved labels
some (the really curved ones) are drawn along the line,
others (the one that end up being straight anyways) are
drawn horizonally. It's a bug. The problem is, where?
Option 1: the code should just ignore the vendor option
in that case, as no line placement was asked for to
start with
Option 2: the code should throw an exception telling
the user to make a decision, point placement or following
the lines?
Option 3: the code should take the vendor option as
an override and forget about the point placement, even
if it was specified explicitly (the code that draws
the labels has no way to tell if the placement was
asked explicitly or just defaulted).
I like option 2. What other people think?
Cheers
Andrea
--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel
Brent Owens ha scritto:
I like option 1.
If you forget to specify point placement yet also specify
"followLine", then you have messed up your SLD in my opinion. Most
likely a copy-paste error.
Now what could be handy is a combination of 1+2. It will ignore the
vendor option, but give you a warning that your SLD is a little mixed
up and some options were ignored. That will help trace down problems
with the SLD.
As SLD files can become unwieldy very quickly, anything to help clean
them up or make them more understandable will be good.
Of course an SLD editor would be great too and would solve these
problems =) But that is definitely not an easy task.
Hey Brent,
so happy to hear you after such a long time 
And thanks a lot for your opinion. 1+2 is a good one as well... thought
it assumes the user is actually looking at the logs. Then again,
the user that has troubles looking in the log might not
understand a service exception either
Cheers
Andrea
--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.