geostyler / geostyler-cql-parser

BSD 2-Clause "Simplified" License
9 stars 5 forks source link

Support for Filter Predicates #313

Open geographika opened 1 year ago

geographika commented 1 year ago

Question

A QML rule such as:

<rule scalemaxdenom="25001" label="public building" filter="&quot;type&quot; IN ('kindergarten', 'civic', 'government', 'hospital', 'school', 'train_station', 'transportation', 'university', 'public', 'toilet', 'religious', 'cathedral', 'chapel', 'church', 'mosque', 'temple', 'synagogue', 'shrine', 'supermarket', 'kiosk', 'retail', 'shop')" description="Gebäude die grundsätzlich öffentlich zugänglich sind; z.B. Schulen, Kirchen, Supermärkte, Ämter, ..." key="{025f854c-d5b6-42f4-b73f-ca62e338cc3c}" scalemindenom="1" checkstate="0" symbol="0"/>

Gets turned into a GeoStyler rule in the form:

  "rules": [
    {
      "name": "public building",
      "filter": {
        "type": "InExpressionListPredicate",
        "hasNot": null,
        "left": "type",
        "right": [
          "kindergarten",
          "civic",
          "government",

I've searched for predicates such as InExpressionListPredicate in the GeoStyler parsers, but get no matches. Are these predicates currently not supported, and need to be added to the individual parsers?

https://github.com/geostyler/geostyler-cql-parser/blob/67cdf57a10710a16fcc4b9b7391ccab1f4aeb8fa/src/cql.jison#L294

jansule commented 1 year ago

I've searched for predicates such as InExpressionListPredicate in the GeoStyler parsers, but get no matches. Are these predicates currently not supported, and need to be added to the individual parsers?

@KaiVolland could you take a look at this?

The created filter in geostyler-style does not look like our filter format. Maybe we have to adjust the jison in the geostyler-cql-parser to create a proper structure for that case.