Opened 15 years ago
Closed 13 years ago
#3064 closed defect (fixed)
SLD: filter with And and PropertyIsLike does not work
Reported by: | bartvde | Owned by: | assefa |
---|---|---|---|
Priority: | normal | Milestone: | 5.6.4 release |
Component: | WMS Server | Version: | 5.6 |
Severity: | normal | Keywords: | |
Cc: | gislab |
Description
An SLD like the following does not work correctly:
<StyledLayerDescriptor xmlns="http://www.opengis.net/sld" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><NamedLayer><Name>GARBANK001</Name><UserStyle><FeatureTypeStyle><Rule><Name>default</Name><ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:And><ogc:PropertyIsEqualTo><ogc:PropertyName>VERVALLEN</ogc:PropertyName><ogc:Literal>nee</ogc:Literal></ogc:PropertyIsEqualTo><ogc:PropertyIsLike wildCard="*" singleChar="." escape="!"><ogc:PropertyName>BAAN</ogc:PropertyName><ogc:Literal>*YY*</ogc:Literal></ogc:PropertyIsLike></ogc:And></ogc:Filter><PolygonSymbolizer><Fill><CssParameter name="fill">#000000</CssParameter></Fill></PolygonSymbolizer></Rule></FeatureTypeStyle></UserStyle></NamedLayer></StyledLayerDescriptor>
In FLTGetLogicalComparisonExpresssion (mapogcfilter.c) first the part stating "special case for PropertyIsLike" is reached, and this function returns. So only 1 part of the filter is actually interpreted and used.
A "hack" which made things work for me is commenting out 1 line in mapogc.sld:
//if (FLTHasSpatialFilter(psNode)) psLayer->layerinfo = (void *)psNode;
Attachments (1)
Change History (8)
comment:1 by , 15 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 15 years ago
Resolution: | → worksforme |
---|---|
Status: | assigned → closed |
comment:3 by , 14 years ago
Milestone: | 5.4.1 release → 5.6.1 release |
---|---|
Resolution: | worksforme |
Status: | closed → reopened |
Under debug I can see filter conversion:
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"> <ogc:Or> <ogc:PropertyIsEqualTo> <ogc:PropertyName>c_ring_e</ogc:PropertyName> <ogc:Literal>UKRAINA</ogc:Literal> </ogc:PropertyIsEqualTo> <ogc:PropertyIsEqualTo> <ogc:PropertyName>c_ring_e</ogc:PropertyName> <ogc:Literal>RUSSIA</ogc:Literal> </ogc:PropertyIsEqualTo> </ogc:Or> </ogc:Filter>
EXPRESSION ( ("[c_ring_e]" = "UKRAINA") Or ("[c_ring_e]" = "RUSSIA") )
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"> <ogc:Or> <ogc:PropertyIsLike wildCard="*" singleChar="%" escape="!"> <ogc:PropertyName>c_ring_e</ogc:PropertyName> <ogc:Literal>UKRAINA</ogc:Literal> </ogc:PropertyIsLike> <ogc:PropertyIsLike wildCard="*" singleChar="%" escape="!"> <ogc:PropertyName>c_ring_e</ogc:PropertyName> <ogc:Literal>RUSSIA</ogc:Literal> </ogc:PropertyIsLike> </ogc:Or> </ogc:Filter>
CLASSITEM "c_ring_e" EXPRESSION /^RUSSIA/
comment:4 by , 14 years ago
Milestone: | 5.6.1 release |
---|---|
Version: | unspecified → 5.6 |
Autotest # Verify PropertyIsLike with logical operators is incorrect:
CLASSITEM "NAME" EXPRESSION /^3/
comment:5 by , 14 years ago
Cc: | added |
---|
comment:6 by , 14 years ago
Milestone: | → 5.6.4 release |
---|
sorry for the delay on this. This was already fixed in trunk part of #2720 (http://trac.osgeo.org/mapserver/changeset/9584)
It was not fixed in the 5.6 branch. I have prepared a patch for the branch. I am a bit hesitate to apply without further tests. Please use the patch and let me know.
comment:7 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
This is fixed in trunk. Closing
Can't reproduce this one anymore.