[mapserver-dev] MapServer Expressions and Bracketing

Lime, Steve D (MNIT) steve.lime at state.mn.us
Wed Oct 9 13:11:17 PDT 2019

The docs are wrong or at least confusing IMHO. The only requirement is that the entire logical expression has a whole needs to be encased in a ()'s so the parser can find it. Sub-expressions do not have to be encased in brackets unless it is needed to establish precedence in terms of how the expression is evaluated. MapServer more closely matches SQL and I wouldn't want to limit that. I do think ()'s can help with readability but they aren't required save the outer ()'s. --Steve

-----Original Message-----
From: mapserver-dev [mailto:mapserver-dev-bounces at lists.osgeo.org] On Behalf Of Seth G
Sent: Wednesday, October 09, 2019 1:41 PM
To: mapserver-dev at lists.osgeo.org
Subject: [mapserver-dev] MapServer Expressions and Bracketing

Hi all,

Not sure if this is more of a dev or user question. The docs for logical expressions state each expression should be encapsulated in round brackets e.g. ( ( Expression1 ) AND ( Expression2 ) ). This is how mappyfile expects them (see issue at [1]), however it seems MapServer is more flexible and allows expressions such as:

EXPRESSION ("[TIME]" eq 'NOW' AND NOT "[TYPE]" ~ "(something|completely|different)")

This should really be:

EXPRESSION (("[TIME]" eq 'NOW') AND NOT ("[TYPE]" ~ "(something|completely|different)"))

So should MapServer 8 become stricter and fail these errors and stick to a tighter spec, or should the docs be updated to reflect the reality of the parsing?


[1] https://github.com/geographika/mappyfile/issues/85

twitter: @geographika
mapserver-dev mailing list
mapserver-dev at lists.osgeo.org

More information about the mapserver-dev mailing list