Skip to content

Fix SLD generation when using string operators such as le#7522

Merged
jmckenna merged 3 commits into
MapServer:mainfrom
geographika:sld-fix
Jun 10, 2026
Merged

Fix SLD generation when using string operators such as le#7522
jmckenna merged 3 commits into
MapServer:mainfrom
geographika:sld-fix

Conversation

@geographika

@geographika geographika commented Jun 10, 2026

Copy link
Copy Markdown
Member

If field names contained operators such as le, ge etc. then these were being picked up as operators.
This PR checks they are surrounded by spaces (and checks for them last after <=).

    LAYER
      NAME "Test32"
      TYPE POINT
      CLASS
        EXPRESSION (([field_le] > 0) AND ([field_le] <= 6))
        STYLE
            COLOR 0 176 80
            WIDTH 1
        END
      END
    END

Without fix would generate:

...
<ogc:PropertyIsLessThanOrEqualTo><ogc:PropertyName>field_</ogc:PropertyName><ogc:Literal>] <= 6</ogc:Literal>

Bug introduced by me in #7182 (comment) which fixed one issue, but created another.

@geographika geographika added the backport branch-8-6 To backport a pull request to branch-8-6 label Jun 10, 2026
@jmckenna

Copy link
Copy Markdown
Member

thanks @geographika !

@jmckenna jmckenna merged commit abaa114 into MapServer:main Jun 10, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport branch-8-6 To backport a pull request to branch-8-6

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants