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
smithkm@anonymised.com
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:
Cheers,
Jonathan
---- On Mon, 25 Apr 2016 07:38:32 +0100 tommasotommasodb@anonymised.com 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
Geoserver-users@lists.sourceforge.net
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
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users