Labels and tiles together is just an intractable problem. All the ways
of dealing with it are going to be unsatisfactory in some way.
Labelling is already a hard problem. It not only requires considering
the feature you are labelling, but all the labels of nearby features,
which depend on those near them and so on. So potentially the label on
only feature could depend on that on any OTHER feature. This also needs
to be done across all layers that are being combined.
So, one solution is to compute the labels for everything everywhere.
This means looking at every single feature. You could pre-computer all
the labels for every zoom level and store them as another layer. This
would be a lot of work and would need to be redone for any change, and
wouldn't allow for dynamic queries.
Or you can chunk the map into sections and label within the sections.
This is the way we do this by default. Using bigger chunks (metatiles)
helps reduce the problem but doesn't fix it. This is the most generally
applicable solution,
Another solution is to cache tiles for everything except tiles, and
then handle labels using non-tiled WMS requests over top. This
obviously looses some of the benefit of caching but can work depending
on the use case.
The lost option is to turn off label conflict resolution and lock down
their placement (Say to the centroid). If labels don't care about
nearby labels and will just draw over top of one another, then the
problem of needing to know about all the other labels on the map goes
away. You just need a big enough gutter to pull in labels that extend
past their features.
--
Kevin Michael Smith
[email protected]
On Mon, Apr 25, 2016, at 06:13 AM, Jonathan Moules wrote:
> Hi Tommaso,
> I can't think of any "ideal" solutions (others may have better
> suggestions), but below are a few ideas:
> * I'm guessing you're using the PointPlacement labelling, which with
> the large metatiling you're using should hopefully ensure only one
> label in any given large area.
>
> * You could use the (area) filter function
> (http://docs.geoserver.org/stable/en/user/filter/function_reference.html#geometric-functions)
> to dynamically calculate the area of a polygon and use this in
> conjunction with the Priority labelling
> (http://docs.geoserver.org/latest/en/user/styling/sld-reference/labeling.html#priority-labeling)
> feature to make sure the largest features are labelled.
>
> * You could create a few identical styles with different scale
> thresholds for given labels and then use a filter with the (area)
> function to decide which of the styles (and thus thresholds) any given
> feature should go in.
>
> * There's also the SpaceAround vendor parameter -
> http://docs.geoserver.org/latest/en/user/styling/sld-reference/labeling.html#overlapping-and-separating-labels-spacearound
>
> Cheers,
> Jonathan
>
> ---- On Mon, 25 Apr 2016 07:38:32 +0100
> *tommaso<[email protected]>* wrote ----
>> Hello, I'm trying to avoid duplicate labels with
>> Geoserver/Geowebcache.
>> Using metatiling 14x14 and gutter=100 helps but does not
>> eliminate ALL
>> duplicates, so I tried the function Centroid(the_geom) in styling.
>> This really eliminates all duplicate labels but has a big
>> disadvantage:
>> the labels of the polygons are shown in all zoom levels,
>> regardless of the
>> size of the polygon, also all labels of all polygons are shown always
>> (this is obvious: using Centroid(the_geom) the geometries are
>> not longer
>> polygons but points). Using normal polygons labeling, the labels
>> of small
>> polygons are only shown after zooming in, when the label fit in the
>> polygon.
>>
>> There is a workaround to avoid this side effect? Or other tricks
>> to avoid
>> duplicate labels?
>>
>> Thanks, Tommaso
>>
>> ---------------------------------------------------------------------
>> ---------
>> Find and fix application performance issues faster with Applications
>> Manager
>> Applications Manager provides deep performance insights into multiple
>> tiers of
>> your business applications. It resolves application problems
>> quickly and
>> reduces your MTTR. Get your free trial!
>> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
>> _______________________________________________
>> Geoserver-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/geoserver-users
> ----------------------------------------------------------------------
> --------
> Find and fix application performance issues faster with
> Applications Manager
> Applications Manager provides deep performance insights into multiple
> tiers of
> your business applications. It resolves application problems
> quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z[1]
> _________________________________________________
> Geoserver-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
Links:
1. https://ad.doubleclick.net/ddm/clk/302982198%3B130105516%3Bz
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users