[udig-devel] Strange SLD behavior
David Adler
dadler at riverby.net
Tue Oct 23 06:16:31 PDT 2007
It isn't surprising that the behavior of the filter is different in the
WFS request than in styling. In the WFS request, the datastore is
converting the filter into some SQL. In styling, GeoTools must have
implemented this filtering.
I've solved the problem by updating the column in the database to trim
off all trailing blanks and now all works as expected.
I'm not familiar enough with the shapefile .dbf file to know how
trailing characters are normally represented for character fields, i.e.,
are they usually blank or null? The .dbf fields are always fixed length
so there has to be some padding. On import into DB2, we preserve the
trailing blanks.
Jody Garnett wrote:
> David Adler wrote:
>> 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?
>>
> You can use a "like" filter; the specification is a bit whacked but
> out of the box it works like SQL; so match against "%San Jose%". I
> wonder why the strings are getting padded out with VARCHAR?
>> 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.
> And what if you Not the Not ;-)
>> When specifying the filter in a GeoServer WFS request, it also
>> appears to ignore trailing blanks.
> Stranger and stranger; to get a fair test you may need to turn back
> the clock to GeoServer 1.3; unless you are doing these tests on uDig
> trunk? Perhaps this problem has already been fixed; if you can find
> out where we can apply the fix to 2.2.x.
> Jody
> _______________________________________________
> User-friendly Desktop Internet GIS (uDig)
> http://udig.refractions.net
> http://lists.refractions.net/mailman/listinfo/udig-devel
More information about the udig-devel
mailing list