I have everything working on my GeoServer except for the labeling. I have searched and I cannot find any solution. I am by no means an expert.

I can modify the look/symbology of my polygons, lines, etc but when I add a style that utilizes a label, nothing shows up on my map. I have created new labels with the sld files I downloaded directly from GeoServer docs. I also changed the attribute field name that I want to use in my shapefile as the label. When I open the layer on the map, nothing shows up, not even the polygon.

I am sure I have not enabled something.

I am using GeoServer 2.4.1

Here is the sld I have recently tried:


<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0"
    xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"
    <Name>Label halo</Name>
      <Title>SLD Cook Book: Label halo</Title>
              <CssParameter name="fill">#40FF40</CssParameter>
              <CssParameter name="stroke">#FFFFFF</CssParameter>
              <CssParameter name="stroke-width">2</CssParameter>
                <CssParameter name="fill">#FFFFFF</CssParameter>
  • Are you sure Times New Roman is available for Geoserver installation? You might check it in Geoserver admin pages. Is it a valid SLD schema by the way? Commented Nov 16, 2013 at 21:30
  • Thanks for the reply zimmi. I pasted the wrong code in my question. I edited my code above with the correct SLD. I got that SLD from the geoserver user docs.
    – DWall
    Commented Nov 16, 2013 at 22:48

1 Answer 1


Check the case of the field name, Postgres treats 'name' and 'NAME' as totally different fields, if the field is not found, the style will not show and there will be an error in your GeoServer log file

  • Mark, thanks for the response. I have verified multiple times that the field "name" is correct. I have also tried numerous other fields with no luck. If I take this line <ogc:PropertyName>name</ogc:PropertyName> out of the SLD code, the polygons show on the map. Once I add that line, nothing shows up on the map. I know for sure that I am matching the field name case for case. This sucks!!!
    – DWall
    Commented Nov 18, 2013 at 0:16
  • This was a gotcha for me some time ago, hence the answer. Are you using a database or shapeFile? Can you post the schema from Postgres or open the Dbf File in the Shape File in Excel and Post a screenshot of the field names? or even better, a screen shot of the layer set up page that lists the fields Commented Nov 18, 2013 at 0:31
  • 1
    Also, look at your GeoServer Log file, right after you make a call to the layer. It will show any errors generated that cause the style to fail. Commented Nov 18, 2013 at 0:32

Your Answer

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

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