-
-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SLD Filters missing due to logicial keywords in expressions #7178
Conversation
CI currently failing due to #7179 |
This indeed feels like band-aid fixing, but better than what we have, so why not. Perhaps a TODO/FIXME comment in the code itself would be welcome. msSLDGetLogicalOperator() would also benefit from a similar logic. |
0c8fa16
to
e31d193
Compare
Yes, these changes are very much trying to make an error-prone approach slightly less buggy. With further tests it appears both @sdlime - could any of the changes in https://mapserver.org/development/rfc/ms-rfc-64.html be used here instead of the current string searching approach? I've a copy of the Lex Yacc book but never got much past the first chapter.. |
I've updated the function so the previous cases such as |
This pull request allows <> to be used for "not equal to" logical expressions, along with the already supported ne and !=. Fixes #6950. When creating SLD filters expressions are created by checking values in strings, so modifications have been added to mapogcsld.cpp have been made to support these. There are still issues around this approach for creating SLD filters as noted in #7178.
When using WMS GetStyles requests to generate SLD I noticed some filters were missing. On debugging it became apparent that any string containing a logical operator was failing to generate a filter:
Was missing the expected filter:
msSLDNumberOfLogicalOperators
had a simple search forAND
,NOT
, andOR
that was finding these words in strings causing errors. This fix attempts to tokenize the string, leaving quoted strings intact to avoid this. It is by no means perfect, and I also had to change previous test cases to have spaces around keywords e.g.(([FID] > 1)And([FID] <= 10))
so that they pass.MapServer seems to be missing a parsing engine for expressions (or at least I can't find anything in the codebase). Without this any SLD expression building is going to be flaky. See also #5894.