How can I force all labels to be visible in GeoServer

I have tried with both

<VendorOption name="conflictResolution">false</VendorOption>


<VendorOption name="spaceAround">-1</VendorOption>

But it doesn't seem to help much. The pointsymbolizer are always visible though. And sometimes it doesn't even feel like its "crouded" when the labels isn't visible.

enter image description here

The (I guess) interesting parts in my sld file looks like following:

                         <CssParameter name="fill">#FFFFFF</CssParameter>
                        <sld:CssParameter name="stroke">#9F0000</sld:CssParameter>
                        <sld:CssParameter name="stroke-width">2</sld:CssParameter>
                  <ogc:Function name="centroid">
                      <CssParameter name="font-family">Arial</CssParameter>
                      <CssParameter name="font-weight">Bold</CssParameter>
                      <CssParameter name="font-size">14</CssParameter>
                        <CssParameter name="fill">#9F0000</CssParameter>
                      <CssParameter name="fill">#FFFFFF</CssParameter>
                    <VendorOption name="conflictResolution">false</VendorOption>

  • try goodnessOfFit with a small number <VendorOption name="goodnessOfFit">0.3</VendorOption> – Ralph Dell Aug 12 '14 at 14:43
  • remember that GeoServer will not draw a label if it would fall off the edge of the map so when using small tiles labelling will probably not be optimal. Try using an untiled layer for your labels. – Ian Turton Aug 12 '14 at 15:13
  • iant>Thank you very much, that solved it! I you like, create your comment as answer, and I will mark it as an correct answer. – Mike001 Aug 13 '14 at 5:49
  • Ralph Dell>Thanks for the response, I have tried that before and that didn't help either. But since I had a tiled layer I guess that it dont matter what I do in the sld – Mike001 Aug 13 '14 at 5:54

Label placement is more an art than a science, GeoServer tries very hard to put as many labels as possible on to your map while making it look good. As part of this it will not draw a label that goes over the edge of the map. This means that with small tiles and relatively large labels it may not be possible to place many (or any) labels. The easiest solution to this is to use an untiled layer with just the labels on which you overlay on top of your map. Since there is not much rendering involved in labeling this should not be too slow if it isn't cached.

You can also work round this using options such as gutters and meta-tiling depending on the exact situation if you must have tiles.

| improve this answer | |

You can use :

<VendorOption name="partials">true</VendorOption>

to tell geoserver to render labels that are partially visible

| improve this answer | |
  • I am using CSS styling with the same problem, any idea how to use "partials" vendor option in CSS style? – Brian B Dec 5 '18 at 20:30
  • Have you tried partials: true; ? – Olyster Dec 6 '18 at 14:05
  • I have not, tried that, however I did look at the code and see no support for "partials" in the CSS styling code. – Brian B Dec 7 '18 at 14:13

In css try label-fit-goodness: -1; and label-conflict-resolution: false;

That will make geoserver render overlapping labels and place them even if they don't fit. All labels will be visible.

| improve this answer | |
  • Could you please elaborate more on this answer (eg. add formatting/ or a more detailed explanation that reflects the context of the question). – root676 May 17 '19 at 7:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.