I have a series of points that I have reading an attribute to display a label. I don't see the labels on my map until Scale = 1 : 1M when SOME of them start to show up. But it's not until I hit Scale = 1 : 545K that they start showing up completely. Is there something I'm missing in my SLD? I've tried numerous things and cannot get these labels to show prior to these zoom levels.

<StyledLayerDescriptor version="1.0.0"
    xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"
    <Name>Simple point</Name>
      <Title>Points with Labels</Title>

                  <CssParameter name="fill">#2234cb</CssParameter>

                <CssParameter name="font-family">Arial</CssParameter>
                <CssParameter name="font-size">12</CssParameter>
                <CssParameter name="font-style">normal</CssParameter>
                <CssParameter name="font-weight">bold</CssParameter>


                <CssParameter name="fill">#fffff0</CssParameter>

             <VendorOption name="conflictResolution">false</VendorOption>
             <VendorOption name="goodnessOfFit">1.0</VendorOption>
            <VendorOption name="autoWrap">75</VendorOption>


Label placement is a subtle art and GeoServer tries hard to do the right thing (no overlapping labels, each label inside it's polygon etc). You seem to be trying to prevent it helping you out in some ways but are forcing it to apply other rules. This leads to unexpected results (like only some of your labels showing up when you have zoomed out).

I've carried out some experiments using the topp:states layer.

This is what I get with (a slightly modified version of) your SLD:

enter image description here

There is just one state (Texas) labeled. If we zoom in a bit we can see more state labels being added:

enter image description here

But a number of smaller states (New England) are still unlabeled. This is because you have requested GeoServer use a goodnessOfFit of 1, this makes it very likely that labels which are not wholly within the polygon will be drawn (the default for polygons is 0.3). So if we turn that down to 0.0 we will get labels with in each polygon.

enter image description here

So now everything is labeled (and the labels are all over the place), now when we zoom out you will still "see" all the labels but reading them will be almost impossible:

enter image description here

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.