Ticket #1637 (closed defect: fixed)

Opened 7 years ago

Last modified 6 years ago

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

Changed 7 years ago by assefa

Bart,

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

Changed 7 years ago by bartvde@…

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.

Changed 7 years ago by assefa

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

Changed 7 years ago by bartvde@…

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

Changed 7 years ago by assefa

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

Changed 7 years ago by bartvde@…

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

Changed 7 years ago by bartvde@…

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>

Changed 6 years ago by tomkralidis

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

Changed 6 years ago by bartvde

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.

Changed 6 years ago by tomkralidis

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.