0

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

3

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 :)

  • Yes, that was it. I created a style without a workspace and it works. thanks @Jendrusk – minisaurus Mar 24 '18 at 16:54

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.