1

I am trying to create a web map using GeoServer, and doing styling via YSLD.

According to YSLD documentation, I should be able to include CQL in order to do filtering.

For a test, I am using OpenStreetMap data from a PostGIS data store. Here is some YSLD that works:

- name: name
  rules:
  - name: motorwaytrunkcasing
    filter: ${highway='motorway'}
    symbolizers:
    - line:
        stroke-color: '#440054'
        stroke-width: 5

No problem there. However, when I add the following CQL:

filter: ${highway='motorway' AND other_tags NOT LIKE '%"tunnel"=>"yes"%' AND (other_tags LIKE '%"bridge"=>"yes"%' OR other_tags LIKE '%"bridge"=>"viaduct"%') AND other_tags LIKE '%"layer"=>"2"%'}

It fails with the following error:

${highway='motorway' AND other_tags NOT LIKE '%"tunnel"=>"yes"%' AND (other_tags LIKE '%"bridge"=>"yes"%' OR other_tags LIKE '%"bridge"=>"viaduct"%') AND other_tags LIKE '%"layer"=>"2"%'} symbolizers ^ Lexical error at line 1, column 1. Encountered: "$" (36), after : ""

I've copy-pasted this CQL to test it using OpenLayers on the same GeoServer, and it is valid; it correctly filters the data.

Might this be a bug?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.