1

I've exported shapefiles and SLDs from ArcGIS to deploy them on GeoServer. The client was using field names longer than 10 symbols so they got truncated. The field upon which the symbology is mainly built turned from SubTypeCode to SUBTYPECOD. I fixed the .slds, so my rules became:

    <Rule>
      <Name><![CDATA[Cable Duct]]></Name>
      <Title><![CDATA[Cable Duct]]></Title>
      <ogc:Filter>
        <ogc:PropertyIsEqualTo>
          <ogc:PropertyName>SUBTYPECOD</ogc:PropertyName>
          <ogc:Literal>941</ogc:Literal>
        </ogc:PropertyIsEqualTo>
      </ogc:Filter>
      <LineSymbolizer>
        <Stroke>
          <CssParameter name="stroke" >#00ab1a</CssParameter>
          <CssParameter name="stroke-width" >1</CssParameter>
          <CssParameter name="stroke-opacity" >1</CssParameter>
        </Stroke>
      </LineSymbolizer>
    </Rule>

On the other hand, my data view says:

enter image description here

But it simply does not apply, I can clearly see that it's falling back to the default symbolizer that is in the end of the .sld. Has anyone ever had something like this?

<NamedLayer>
    <Name><![CDATA[HAL_OilGas_Line]]></Name>
    <UserStyle>
        <FeatureTypeStyle>
            <Rule>
                <Name><![CDATA[Cable Duct]]></Name>
                <Title><![CDATA[Cable Duct]]></Title>
                <ogc:Filter>
                    <ogc:PropertyIsEqualTo>
                        <ogc:PropertyName>SUBTYPECOD</ogc:PropertyName>
                        <ogc:Literal>941</ogc:Literal>
                    </ogc:PropertyIsEqualTo>
                </ogc:Filter>
                <LineSymbolizer>
                    <Stroke>
                        <CssParameter name="stroke" >#00ab1a</CssParameter>
                        <CssParameter name="stroke-width" >1</CssParameter>
                        <CssParameter name="stroke-opacity" >1</CssParameter>
                    </Stroke>
                </LineSymbolizer>
            </Rule>
            <Rule>
                <Name><![CDATA[Cable Tray]]></Name>
                <Title><![CDATA[Cable Tray]]></Title>
                <ogc:Filter>
                    <ogc:PropertyIsEqualTo>
                        <ogc:PropertyName>SUBTYPECOD</ogc:PropertyName>
                        <ogc:Literal>935</ogc:Literal>
                    </ogc:PropertyIsEqualTo>
                </ogc:Filter>
                <LineSymbolizer>
                    <Stroke>
                        <CssParameter name="stroke" >#960062</CssParameter>
                        <CssParameter name="stroke-width" >1</CssParameter>
                        <CssParameter name="stroke-opacity" >1</CssParameter>
                    </Stroke>
                </LineSymbolizer>
            </Rule>
            <Rule>
                <Name><![CDATA[Mapping Limit Extent]]></Name>
                <Title><![CDATA[Mapping Limit Extent]]></Title>
                <ogc:Filter>
                    <ogc:PropertyIsEqualTo>
                        <ogc:PropertyName>SUBTYPECOD</ogc:PropertyName>
                        <ogc:Literal>920</ogc:Literal>
                    </ogc:PropertyIsEqualTo>
                </ogc:Filter>
                <LineSymbolizer>
                    <Stroke>
                        <CssParameter name="stroke" >#9e6c00</CssParameter>
                        <CssParameter name="stroke-width" >1</CssParameter>
                        <CssParameter name="stroke-opacity" >1</CssParameter>
                    </Stroke>
                </LineSymbolizer>
            </Rule>
            <Rule>
                <Name><![CDATA[Pipe Bridge Line]]></Name>
                <Title><![CDATA[Pipe Bridge Line]]></Title>
                <ogc:Filter>
                    <ogc:PropertyIsEqualTo>
                        <ogc:PropertyName>SUBTYPECOD</ogc:PropertyName>
                        <ogc:Literal>926</ogc:Literal>
                    </ogc:PropertyIsEqualTo>
                </ogc:Filter>
                <LineSymbolizer>
                    <Stroke>
                        <CssParameter name="stroke" >#0049b0</CssParameter>
                        <CssParameter name="stroke-width" >1</CssParameter>
                        <CssParameter name="stroke-opacity" >1</CssParameter>
                    </Stroke>
                </LineSymbolizer>
            </Rule>
            <Rule>
                <Name><![CDATA[Pipeline]]></Name>
                <Title><![CDATA[Pipeline]]></Title>
                <ogc:Filter>
                    <ogc:PropertyIsEqualTo>
                        <ogc:PropertyName>SUBTYPECOD</ogc:PropertyName>
                        <ogc:Literal>909</ogc:Literal>
                    </ogc:PropertyIsEqualTo>
                </ogc:Filter>
                <LineSymbolizer>
                    <Stroke>
                        <CssParameter name="stroke" >#00528c</CssParameter>
                        <CssParameter name="stroke-width" >1</CssParameter>
                        <CssParameter name="stroke-opacity" >1</CssParameter>
                    </Stroke>
                </LineSymbolizer>
            </Rule>
            <Rule>
                <Name><![CDATA[Piping]]></Name>
                <Title><![CDATA[Piping]]></Title>
                <ogc:Filter>
                    <ogc:PropertyIsEqualTo>
                        <ogc:PropertyName>SUBTYPECOD</ogc:PropertyName>
                        <ogc:Literal>1049</ogc:Literal>
                    </ogc:PropertyIsEqualTo>
                </ogc:Filter>
                <LineSymbolizer>
                    <Stroke>
                        <CssParameter name="stroke" >#003780</CssParameter>
                        <CssParameter name="stroke-width" >1</CssParameter>
                        <CssParameter name="stroke-opacity" >1</CssParameter>
                    </Stroke>
                </LineSymbolizer>
            </Rule>
            <Rule>
                <Name><![CDATA[<all other values>]]></Name>
                <Title><![CDATA[<all other values>]]></Title>
                <LineSymbolizer>
                    <Stroke>
                        <CssParameter name="stroke" >#3ca300</CssParameter>
                        <CssParameter name="stroke-width" >1</CssParameter>
                        <CssParameter name="stroke-opacity" >1</CssParameter>
                    </Stroke>
                </LineSymbolizer>
            </Rule>
        </FeatureTypeStyle>
    </UserStyle>
</NamedLayer>
4
  • 1
    After importing the sld, did you actually publish the layer with this particular sld? Commented Aug 28, 2014 at 13:40
  • of course I did) I see it falling through all the rules to the default one. But all the features actually have this property Commented Aug 28, 2014 at 16:02
  • In that case, the error is somewhere else in the SLD. Can you share the whole SLD? Commented Aug 28, 2014 at 16:57
  • Added the whole body of SLD Commented Aug 28, 2014 at 18:06

1 Answer 1

2

Problem solved. I was ignorant to the fact that they're cascading so I completely trusted those auto-generated .slds. The most general rule had to come first.

Thanks everybody.

By the way, if someone is interested how I extracted the SLDs - I did it with the trial version of Arc2Earth. It only allows you to do that layer by layer, but at least it's possible.

1
  • Aha yes, That's an Important point that I tend to forget quite often. Commented Aug 29, 2014 at 8:09

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.