Friday 28 August 2015

geoserver - Labels on tiled map sometimes unavailable


I have following case. Map of highway with labeled points placed by some interval. Problem is with labels that are partially on particular tile. Sometimes they are not drawn completely. I tried to find out which code is responsible for exact drawing but geoserver is too complicated for me on first attempt. I'm looking for help with schema around drawing flow in just master branch of geoserver or any practical resolution of my case.


enter image description here



Answer



The quickest and easiest solution is to not tile your labels layer. However if this is not an option for you then read on.


In general GeoServer tries very hard not to draw labels that won't look good (for some value of good) - i.e. where they overlap, or fall off the side of the map as for most people these look ugly. However because the developers' idea of good may differ from yours as in this case there are a variety of helpful vendor-options (which are GeoServer extensions to the SLD standard) that allow you to override the labeling engine.



The labeling options page is the best place to start if you have a labeling issue with GeoServer, and for your issue you need to look at setting the partials option:


true

This will force the renderer to draw labels that fall off the edges of the map. You will have to provide a fixed point for the label to be drawn otherwise the label on the other side of the tile boundary will not line up. I've never tried this solution but I suspect you will need to set MetaTiling to be on too so that the off tile labels are drawn (so you get the matching ends of labels).


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...