[Geoserver-devel] Unique Label property In <TextSymbolizer> (SLD file)

Rong,

Yes, there are known issues with the way labeling is occuring now. I've
sent quite a few message on this top to this and the geotools-devel
list.

The main problem is that the current labeling system is designed to
display road name labels, and hasnt been abstracted out to handle other
types of situations.

So, when you label something, you are actually grouping all the geometry
objects with the same label together. Each group is then evaluated and
and the best "representational" geometry is created. That one geometry
is then labeled.

So, if look at most road data, you'll see a set of "Broadway" line
segments - one for each block. You dont want to label ever segment
with "Broadway", so we network together all the lines with the
"Broadway" label and just label this "supra" line. It works extreamly
well for what its doing.

It also doesnt allow labels to overlap.

Unfortunately, for many other tasks, you dont want this to process to
occur. In your case, you have multiple objects with same label, so
they are being grouped together and only one label is being drawn.

A full "fixing" of this would involve:

1. Some type of geotools/geoserver-specific parameters in the SLD file
to control how the labeling occurs.

<VendorSpecificParameter name="...">...</VendorSpecificParameter>

   * This shouldnt actually be too difficult to do, but it does mean
that these SLD file may not work on other WMS servers (which is one of
the main advanatages of using SLD).
   * The PMC has already voted to accept this change, but no-one's
actually done it.

2. Change the render/labeler to actually properly process these
parameters. This could actually be HUGE amount of work since there are
some very fancy labeling algorthms available.

What needs to occur first is to figure out what people actually want in
their labeler(s) and then figure out how we're going to represent those
options (#1) and how to actually implement them (#2).

Now that I've got anti-aliasing on (my WMS pictures look good), I'm more
motivated to actually work on this. Do you want to work together on
this? Anyone else?

dave

----------------------------------------------------------
This mail sent through IMP: https://webmail.limegroup.com/

Hi, Dave,
  Thank you very much for the suggestions. I'm think about we can put a
kind of switch tag in the SLD file which can switch on the group or not
group the label. Do you think it is easy or not. I don't have enough
time. This project have to be finished before Aug.6th.
  I'm also think about another way to go around it. I'm think about if I
set a new layer for each the geometry even it will take more resource.
Is this will solve my problem? Anyway, I'll try this.
  Please let me know what I can do.
  Thanks again.
  Rong

Rong,

Yes, there are known issues with the way labeling is occuring now. I've
sent quite a few message on this top to this and the geotools-devel
list.

The main problem is that the current labeling system is designed to
display road name labels, and hasnt been abstracted out to handle other
types of situations.

So, when you label something, you are actually grouping all the geometry
objects with the same label together. Each group is then evaluated and
and the best "representational" geometry is created. That one geometry
is then labeled.

So, if look at most road data, you'll see a set of "Broadway" line
segments - one for each block. You dont want to label ever segment
with "Broadway", so we network together all the lines with the
"Broadway" label and just label this "supra" line. It works extreamly
well for what its doing.

It also doesnt allow labels to overlap.

Unfortunately, for many other tasks, you dont want this to process to
occur. In your case, you have multiple objects with same label, so
they are being grouped together and only one label is being drawn.

A full "fixing" of this would involve:

1. Some type of geotools/geoserver-specific parameters in the SLD file
to control how the labeling occurs.

<VendorSpecificParameter name="...">...</VendorSpecificParameter>

   * This shouldnt actually be too difficult to do, but it does mean
that these SLD file may not work on other WMS servers (which is one of
the main advanatages of using SLD).
   * The PMC has already voted to accept this change, but no-one's
actually done it.

2. Change the render/labeler to actually properly process these
parameters. This could actually be HUGE amount of work since there are
some very fancy labeling algorthms available.

What needs to occur first is to figure out what people actually want in
their labeler(s) and then figure out how we're going to represent those
options (#1) and how to actually implement them (#2).

Now that I've got anti-aliasing on (my WMS pictures look good), I'm more
motivated to actually work on this. Do you want to work together on
this? Anyone else?

dave

----------------------------------------------------------
This mail sent through IMP: https://webmail.limegroup.com/