mapscript and logical expressions

Robert Chavez rchavez at perseus.tufts.edu
Fri Feb 4 13:37:03 EST 2000


That did it.  Thanks.  I'm going to fool around with between 5 and 8 logical expressions in a
particular layer, just to see what happens to performance.  I don't plan on using that many,
but I will have 2 or 3 per layer.

Rob Chavez
Perseus Project

Stephen Lime wrote:

> The replacements for logical expressions are case sensitive just like when using
> mapserver templates. Most shapefiles use all caps for item names so try [ZV2] instead
> of [Zv2]. Note, as of 3.3.006 you can't change class EXPRESSION or TEXT values from
> within mapscript. Still figuring out the most robust way to distinguish between expression
> types without firing up the lexer.
>
> Also note that CLASSITEM is unused with logical expressions at present. Curiously, how
> common are multiple item logical expressions in user's plans? By only allowing a single
> item logical expressions would speed up a bit. Any thought?
>
> Steve
>
> Stephen Lime
> Internet Applications Analyst
>
> Minnesota DNR
> 500 Lafayette Road
> St. Paul, MN 55155
> 651-297-2937
>
> >>> Robert Chavez <rchavez at perseus.tufts.edu> 02/04/00 08:38AM >>>
>
> Greetings,
>
> I've just gotten around to trying the new logical expressions in classes
> and I'm having trouble getting results.  Utimately I want to use logical
> expresssions with ranges of numbers, but I tried these simple examples
> with string, regex, and logical expressions just to test the various
> expression options (using mapscript from the latest release 3.3.006):
>
> <snip>
> NAME Contours
>   TYPE LINE
>   STATUS OFF            #mapscript handles status change
>   DATA contourlines1
>   MAXSCALE 4000000
>   CLASSITEM "Zv2"
>   CLASS
>     NAME "Contour lines"
>     #EXPRESSION "914"  works, returns contours at this elevation
>     #EXPRESSION /^914/ works, returns contours beginning with string 914
>     #EXPRESSION ([Zv2] eq '914') doesn't work, returns nothing
> ...
> </snip>
>
> I've tried a couple variations of the logical expression, but still no
> luck.  Does anyone have any ideas?
>
> Thanks,
>
> Rob Chavez
> Perseus Project
> rchavez at perseus.tufts.edu




More information about the mapserver-users mailing list