M.S.Bachler wrote:

Right, I downloaded the data.zip and had a play.
I tried to write a sld for the bc_hospitals shapefile as this seemed to
be a point shapefile.
I read the SLD spec and produced what I thought was a correct sld file,
with the correct name (bc_hospitals.sld).
But UDIG does not draw the layer when I drop the bc_hospitals.shp file
onto a map (that has one other layer of bc_bounrder.shp).

I tried opening the StyleEditor for the bc_hospitals layer, and looking
at the XML. I tried to validate it, to see if it could tell me what was wrong. Udig just went off and never came back. I waited 10 minutes and crashed out.

So I am a bit stuck.
I have attached my bc_hospitals.sld file and the png file I am trying to
use for this test.
(you will need the edit the href in the sld file to point to wherever
you put the ong file)

Can someone figure out what I am doing wrong?
Hi Michelle,

Sorry for the delay. I haven't been able to reproduce this problem entirely, but have met errors while attempting to do so. From the Style Editor, I manually imported your SLD file with the Import button, and slightly modified it to remove the empty mark and adjust the file path. Hitting apply caused the map to be rendered without any visible hospital points, and several instances in the logger of:

22-Mar-2006 10:10:09 AM org.geotools.renderer.shape.StyledShapePainter paint
SEVERE: ShapePainter has been asked to paint a null style!!

After some playing around, I discovered that the xlink:href parameter is very picky...

file:/C:/house2.PNG <-- works
file://C:/house2.PNG <-- doesn't work
file:///C:/house2.PNG <-- works

I'm still puzzled however that the SLD Validator hung -- or is it simply weak on feedback (at the moment, when the hour glass goes away and no errors appear, your SLD is valid).

Please see attached SLD and screenie...

Cheers,
Cory.

GIF image

<?xml version="1.0" encoding="UTF-8"?>
<sld:StyledLayerDescriptor xmlns:sld="http://www.opengis.net/sld"; xmlns:ogc="http://www.opengis.net/ogc"; xmlns:gml="http://www.opengis.net/gml"; version="1.0.0">
    <sld:UserLayer>
        <sld:LayerFeatureConstraints>
            <sld:FeatureTypeConstraint/>
        </sld:LayerFeatureConstraints>
        <sld:UserStyle>
            <sld:Name>Hospitals by Continent</sld:Name>
            <sld:Title>Default Styler</sld:Title>
            <sld:Abstract></sld:Abstract>
            <sld:FeatureTypeStyle>
                <sld:Name>name</sld:Name>
                <sld:Title>title</sld:Title>
                <sld:Abstract>abstract</sld:Abstract>
                <sld:FeatureTypeName>bc_hospitals</sld:FeatureTypeName>
                <sld:SemanticTypeIdentifier>generic:geometry</sld:SemanticTypeIdentifier>
                <sld:Rule>
                    <sld:Name>name</sld:Name>
                    <sld:Title>title</sld:Title>
                    <sld:Abstract>Abstract</sld:Abstract>
                    <sld:PointSymbolizer>
                        <sld:Graphic>
                            <sld:ExternalGraphic>
                                <sld:OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"; xlink:type="simple" xlink:href="file:/C:/house2.PNG"/>
                                <sld:Format>image/png</sld:Format>
                            </sld:ExternalGraphic>
                            <sld:Opacity>
                                <ogc:Literal>1.0</ogc:Literal>
                            </sld:Opacity>
                            <sld:Size>
                                <ogc:Literal>32</ogc:Literal>
                            </sld:Size>
                            <sld:Rotation>
                                <ogc:Literal>0.0</ogc:Literal>
                            </sld:Rotation>
                        </sld:Graphic>
                    </sld:PointSymbolizer>
                </sld:Rule>
            </sld:FeatureTypeStyle>
        </sld:UserStyle>
    </sld:UserLayer>
</sld:StyledLayerDescriptor>

_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel

Reply via email to