[udig-devel] Strange SLD behavior

David Adler dadler at riverby.net
Fri Oct 19 08:57:56 PDT 2007


I'm trying to something pretty basic, shading polygons based on 
attribute values using a rule/filter.  The relevant part is:

                <sld:Rule>
                    <sld:Name>name</sld:Name>
                    <sld:Title>title</sld:Title>
                    <sld:Abstract>Abstract</sld:Abstract>
                    <ogc:Filter>
                        <ogc:PropertyIsEqualTo>
                            <ogc:PropertyName>PO_NAME</ogc:PropertyName>
                            <ogc:Literal>San Jose</ogc:Literal>
                        </ogc:PropertyIsEqualTo>
                    </ogc:Filter>
                    <sld:PolygonSymbolizer>
                        <sld:Fill>
                            <sld:CssParameter name="fill">
                                <ogc:Literal>#FF4D4D</ogc:Literal>
                            </sld:CssParameter>
                            <sld:CssParameter name="fill-opacity">
                                <ogc:Literal>0.7</ogc:Literal>
                            </sld:CssParameter>
                        </sld:Fill>
                    </sld:PolygonSymbolizer>
                </sld:Rule>

When I apply this to a shapefile layer in uDig, the fill works as expected.

When I apply this to a DB2 layer in uDig based on a shapefile that was 
imported, the rule does not get applied.  After some investigation, I 
determined that although the names are stored in VARCHAR columns, they 
are padded with blanks on the right.  I guess it isn't too surprising 
that the rule doesn't get applied - is there some way to not treat 
trailing blanks as significant?

The strange thing is that if I enclose the <sld:PropertyIsEqualTo> with 
<sld:Not>, all features except "San Jose" are shaded so in this case it 
appears to be ignoring trailing blanks.

When specifying the filter in a GeoServer WFS request, it also appears 
to ignore trailing blanks.



More information about the udig-devel mailing list