MapServer / MapServer-import

3 stars 2 forks source link

Filter logical operator <OR> not working properly in SLD #2147

Open tbonfort opened 12 years ago

tbonfort commented 12 years ago

Reporter: capgree Date: 2007/07/10 - 14:00 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>
tbonfort commented 12 years ago

Author: assefa Date: 2008/06/03 - 16:51 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.

tbonfort commented 12 years ago

Author: assefa Date: 2009/10/13 - 20:17 Update since the last comment is that, it is possible now to specify the field type matada ows/wfs/gml_[item name]_type (see #3052). Closing.