Opened 18 years ago

Closed 17 years ago

#1637 closed defect (fixed)

SLD WMS GetStyles: bug translating regex to PropertyIsLike

Reported by: bartvde@… Owned by: mapserverbugs
Priority: high Milestone:
Component: WMS Server Version: 4.8
Severity: normal Keywords:
Cc:

Description

In my layer there is the following regex for a certain class:

CLASS 
  EXPRESSION /V\*/ 
  STYLE 
    COLOR 170 170 73 
    SYMBOL 0 
  END 
  NAME "V* =  H 25-40  L 120" 
END

When doing a GetStyles request, the following Rule is generated:

<Rule>
<Name>V* =  H 25-40  L &gt;120</Name>
<ogc:Filter><ogc:PropertyIsLike wildCard="*" singleChar="#"
escape="!"><ogc:PropertyName>EERSTE_GWT</ogc:PropertyName><ogc:Literal>V\*</ogc:Literal></ogc:PropertyIsLike></ogc:Filter>
<MaxScaleDenominator>100000.000000</MaxScaleDenominator>
<PolygonSymbolizer>
<Fill>
<CssParameter name="fill">#aaaa49</CssParameter>
</Fill>
</PolygonSymbolizer>
</Rule>
<Rule>

The OGC literal used is not correct ofcourse, ideally this should be translated
into a Ogc:PropertyIsEqualTo with a literal of V*.

Change History (10)

comment:1 by assefa, 18 years ago

Bart,

 It could also be converted to PropertyIsLike but the escape character would 
be "\". Is that correct ? 

comment:2 by bartvde@…, 18 years ago

Assefa, that sounds good to me, it should work that way.

Btw, I am currently "integrating" Mapserver's SLD output with the Ionic WFS/WMS
software, which got me to track this issue down. Ionic would not render the
Rules which are described in this bug report.

comment:3 by assefa, 18 years ago

I updated the code to have the backslah as the default escape character. 

comment:4 by bartvde@…, 18 years ago

Thanks Assefa! Is this in 4.8 or only in 4.9?

comment:5 by assefa, 18 years ago

only 4.9.  4.8.0 is forzen AFAIK. It can make it to 4.8.1 if you like.

comment:6 by bartvde@…, 18 years ago

Funny thing is the \ as escape character does not seem to work for Ionic :-(,
but I think that's a problem on their side ....

comment:7 by bartvde@…, 18 years ago

This does not work for Ionic:

<Rule>
<Name>V* =  H 25-40  L >120</Name>
<ogc:Filter>
<ogc:PropertyIsLike wildCard="*" singleChar="#" escape="\">
<ogc:PropertyName>EERSTE_GWT</ogc:PropertyName>
<ogc:Literal>V\*</ogc:Literal>
</ogc:PropertyIsLike>
</ogc:Filter>
<MaxScaleDenominator>100000.000000</MaxScaleDenominator>
<PolygonSymbolizer>
<Fill>
<CssParameter name="fill">#aaaa49</CssParameter>
</Fill>
</PolygonSymbolizer>
</Rule>

The following does work:
<Rule>
<Name>V* =  H 25-40  L >120</Name>
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>EERSTE_GWT</ogc:PropertyName>
<ogc:Literal>V*</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
<MaxScaleDenominator>100000.000000</MaxScaleDenominator>
<PolygonSymbolizer>
<Fill>
<CssParameter name="fill">#aaaa49</CssParameter>
</Fill>
</PolygonSymbolizer>
</Rule>

comment:8 by tomkralidis, 17 years ago

Bart: so it looks like MapSever is honouring the spec? Do you still think this should be outputted as PropertyIsEqualTo as opposed to PropertyIsLike?

comment:9 by bartvde, 17 years ago

I think PropertyIsEqualTo has a higher chance of working in other implementations as opposed to PropertyIsLike with an escape character, but as you say Mapserver does this correctly according to the spec. I don't mind if you decide to close this one.

comment:10 by tomkralidis, 17 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.