1

I'm trying to load some pictures into my map. They are supposed to be images which are in a local folder of my pc. This is my SLD file:

<StyledLayerDescriptor 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" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd">
    <NamedLayer>
        <Name/>
        <UserStyle>
            <Name>Leghe: grafico a torta</Name>
            <FeatureTypeStyle>
                <Rule>
                  <Title>Large</Title>
                    <ogc:Filter>
                            <ogc:PropertyIsLike wildCard="*" singleChar="." escape="!">
                                <ogc:PropertyName>classificazione</ogc:PropertyName>
                                <ogc:Literal>servito tramite ns cliente</ogc:Literal>
                            </ogc:PropertyIsLike>
                    </ogc:Filter> 
                    <MaxScaleDenominator>4000000</MaxScaleDenominator>
                    <PointSymbolizer>
                        <Graphic>
                            <ExternalGraphic>
                                <OnlineResource xlink:type="simple" xlink:href="cliente.png"/>
                                <Format>image.png</Format>
                            </ExternalGraphic>
                            <Size>
                                <ogc:Literal>70</ogc:Literal>
                            </Size>
                        </Graphic>
                    </PointSymbolizer>
                </Rule>
            </FeatureTypeStyle>
        </UserStyle>
    </NamedLayer>
</StyledLayerDescriptor>

I have put both the sld file and the cliente.png in the Style Directory as said here http://girona-geoserver-workshop.readthedocs.org/en/latest/styling/styles.html but that's the result

enter image description here

what I'm doing wrong?? Please help me!!

1

I finally solved the problem. I hope it might be useful to someone else...

This is the string I needed it so that GeoServer could see my image

xlink:href="file:///C:/Program%20Files%20(x86)/Boundless/OpenGeo/jetty/webapps/geoserver/data/styles/cliente.png"/>

It finally worked! And I also find out that GeoServer cannot access all the folder of your pc, so watch out especially when working on a pc which has a domain. The reason GeoServer couldn't "access" the image was that it didn't have the permission to access the folder (despite I'm an administrator user).

0

Make sure you have permission to write to /.../tomcat/temp

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.