After talking with James, I've decided to start improving the Labeler
(again).
My first improvement will be to add "priority labeling". Right now,
labeling order is random (ie. based on the hashtable). I'd like to
change it so I can give features different "priority" values so they
show up "first".
Here's a simple example;
I have a city DB (point, population, name) and, on my map, i want "New
York" (population 8,000,000) to be drawn before "Yonkers" (population
200,000). These 2 cities are very close, so if only one can be drawn I
want New York to be drawn instead of it being "random".
Another example would be to use "<Function name='geomArea'>" to so you
can have "Central Park" labeled instead of "The Pool" (a little lake in
the middle of the park.
This isnt too difficult a change;
1. add an expression "labelPriority" to TextSymbolizer
+ default = 1,000 (or what have you)
2. Modify the HashTable so that it also stores the priority value
+ for items-with-the-same-label-grouping I think we should use an
"add" priority strategy for the group. In the future, we'll have ways
of turning off grouping.
3. Modify the labeler so instead of just grabbing stuff from the
hashtable, it sorts it on the priority value
4. modify the SLD parse so it has a "<Priority>" tag with an
<Expression> inside it
5. update the geoserver SLD validator so the .xsd reflects the extra
Priority tag.
You'll notice that the results will be the same as they are now if
people dont put a "<Priority>" tag in, so this is backwards compatible.
There could be some layer-to-layer conflicts, but thats up to the people
writing the SLDs deal with.
I believe the PMC already gave an okay to these changes a while ago, I
(or anyone else) havent had a chance to do them.
Other improvements will be things like:
* grouping - on/off
* always render (for people who dont care if the label overlaps)
I'd like to see the labeling get pretty good, since its probably one of
the top "missing pieces" in Geotools (apart from really good raster
support - which others are currently working on). Does anyone have any
comments or other things that they want supported? Anyone willing to
help (ie. programming, testing, giving feedback, trying it on their
data to see how the results look)...
NOTE: THE BIGGEST PROBLEM ABOUT THIS IS THAT OUR SLD FILE WILL NO LONGER
BE 100% OGC 1.0 COMPATIBLE.
We've already discussed this and noone (except me) has had a problem
with it. But, we really dont have any other way of doing this.
dave
----------------------------------------------------------
This mail sent through IMP: https://webmail.limegroup.com/