Ticket #2147 (assigned defect)

Opened 1 year ago

Last modified 3 months ago

Filter logical operator <OR> not working properly in SLD

Reported by: capgree Assigned to: assefa (accepted)
Priority: normal Milestone: 5.2.1 release
Component: WMS Server Version:
Severity: normal Keywords: SLD Filter OR operator
Cc:

Description

It seems that values entered in Filter expressions in SLD rules which use the logical operator OR are not used properly in some cases. I noticed this when combining numeric and string values. I.e. (QUALI is a text field from a shapefile)

1 - This will work:

<Filter>
<PropertyIsEqualTo>
<PropertyName>QUALI</PropertyName>
<Literal>24</Literal>
</PropertyIsEqualTo>
</Filter>

2 - This will also work:

<Filter>
<PropertyIsEqualTo>
<PropertyName>QUALI</PropertyName>
<Literal>24a</Literal>
</PropertyIsEqualTo>
</Filter>

3 - But this will fail:

<Filter>
 <OR>
<PropertyIsEqualTo>
<PropertyName>QUALI</PropertyName>
<Literal>24</Literal>
</PropertyIsEqualTo>
<PropertyIsEqualTo>
<PropertyName>QUALI</PropertyName>
<Literal>24a</Literal>
</PropertyIsEqualTo>
 </OR>
</Filter>

4 - Althought this will work:

<Filter>
 <OR>
<PropertyIsEqualTo>
<PropertyName>QUALI</PropertyName>
<Literal>11x</Literal>
</PropertyIsEqualTo>
<PropertyIsEqualTo>
<PropertyName>QUALI</PropertyName>
<Literal>24a</Literal>
</PropertyIsEqualTo>
 </OR>
</Filter>

Change History

07/10/07 13:32:40 changed by sdlime

  • owner changed from sdlime to assefa.
  • component changed from AGG to WMS Server.

06/03/08 10:51:26 changed by assefa

  • status changed from new to assigned.
  • milestone set to 5.2 release.

The fact that QUALI is a text field is not known to the filler encoding. There is an assumption done based on the value, so that if the value is a number, It is assumed thate the attrubute is a number and if the value is not a number, It is assumed to be a text field. So you could end up with expressions such as ([QUALI] = 24) and ("[QUALI]" = "24a"). Could this explain you problem?

Please also check http://trac.osgeo.org/mapserver/ticket/2635 since It allows you to see the temporary map file after the sld is applied.