[mapserver-dev] MapServer Expressions and Bracketing
Daniel Morissette
dmorissette at mapgears.com
Wed Oct 9 13:12:37 PDT 2019
What Steve wrote was also my understanding, so I'd vote for updating the
docs to match the current behavior (and avoid breaking existing maps).
Daniel
On 2019-10-09 16:11, Lime, Steve D (MNIT) wrote:
> 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?
>
> Seth
>
> [1] https://github.com/geographika/mappyfile/issues/85
>
>
> --
> web:http://geographika.co.uk
> twitter: @geographika
> _______________________________________________
> mapserver-dev mailing list
> mapserver-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-dev
> _______________________________________________
> mapserver-dev mailing list
> mapserver-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-dev
>
--
Daniel Morissette
Mapgears Inc
T: +1 418-696-5056 #201
More information about the mapserver-dev
mailing list