0

I am trying to setup meta-tiling in Geoserver 2.8.0 (I can version up if necessary) in order to prevent multiple labels on polygons which span across tiles.

I am using Leaflet (1.0 RC) on the client.

L.tileLayer.wms("http://178.62.114.162:8080/geoserver/geolytix/wms", {
  layers: 'seamless_locales',
  format: 'image/png',
  transparent: true,
  styles: 'seamless_locales',
  tiled: true,
  tilesorigin: [-180, 90]
})

I was initially confused about the tiles origin. Turns out that it doesn't matter whether I use [-180, 90] or [-180, -90]. The result is the same. See screenshot. Left without meta-tiling, right with meta-tiling.

enter image description here

There are still some duplicate labels in the meta-tiled example. As suggested in the comments this might is probably due to the meta-tile size which is 3*3.

I am trying to change the meta-tile size but have yet been unable to do so.

Edit:

I changed the labels to a point layer of the polygon centroids but labels are not rendered across the tile boundaries and I don't like the idea of having a separate layer for labels.

enter image description here

I am having a workaround with a non-tiled layer leaflet plugin which works well. It's neither the prettiest or quickest solution but it works.

7
  • By reading docs.geoserver.org/stable/en/user/services/wms/… the left bottom is probably at [-180, -90] if your Leaflet map is in EPSG:4326. However, 3x3 metatiles are not so big and it is possible that large polygons are split to several metatiles and are getting many labels. By putting label into centroid of the polygon this might be avoided.
    – user30184
    Commented May 31, 2016 at 10:30
  • Guess the problem is related to the 3*3 meta tiles. Commented May 31, 2016 at 11:01
  • With the integrated GeoWebCache you can use bigger metatiles geowebcache.org/docs/current/concepts/metatiles.html. The default is 4x4 but it can be increased.
    – user30184
    Commented May 31, 2016 at 11:10
  • Metatile size can be set in the layer settings, but you really need to set partial labels in the sld
    – Ian Turton
    Commented May 31, 2016 at 11:11
  • 1
    Yes, they are always 3x3, not configurable, as the other 8 tiles are kept in memory for a small amount of time. Commented Jun 1, 2016 at 9:35

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.