[GIS] Geoserver SLD style PointSymbolizer ExternalGraphic issue

geoserverpngsld

Any idea why this isn't working? It's taken straight from here: http://geoserver.readthedocs.io/en/latest/_downloads/point_pointasgraphic.sld refernced from this page http://geoserver.readthedocs.io/en/latest/styling/sld-cookbook/points.html

<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0" 
    xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" 
    xmlns="http://www.opengis.net/sld" 
    xmlns:ogc="http://www.opengis.net/ogc" 
    xmlns:xlink="http://www.w3.org/1999/xlink" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <NamedLayer>
    <Name>Point as graphic</Name>
    <UserStyle>
      <Title>GeoServer SLD Cook Book: Point as graphic</Title>
      <FeatureTypeStyle>
        <Rule>
          <PointSymbolizer>
            <Graphic>
              <ExternalGraphic>
                <OnlineResource
                  xlink:type="simple"
                  xlink:href="see-saw.png" />
                <Format>image/png</Format>
              </ExternalGraphic>
              <Size>32</Size>
            </Graphic>
          </PointSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

My graphic is located in the 'styles' directory of the geoserver data directory, but instead of the graphic I get a grey square. Geoserver version 2.7.1.1

Best Answer

Check please if your style isn't in some workspace - workspaces has their own store, so images for styles in workspace should be placed in (geoserver_data_dir)/workspaces/(workspace_name)/styles not in (geoserver_data_dir)/styles

You could also check in geoserver log's - there are handy informations if you omit all java's stack-trace :)

Related Question