Expression not working on mapserver

Steve Lime steve.lime at DNR.STATE.MN.US
Mon Aug 1 23:46:23 EDT 2005


There are 2 problems: 

1) EXPRESSION "([roadtype] = 'freeway')" should be
    EXPRESSION ([roadtype] = 'freeway')

No qoutes around the logical expression otherwise MapServer treats the whole thing as one big string.

2) EXPRESSION ([roadtype] = 'freeway') should be
    EXPRESSION ('[roadtype]' = 'freeway')

MapServer doesn't know anything about item types or anything so you must be overly explicit when preparing expressions. Same applies to the rest of your mapfile.

Steve

>>> "Lego han (aka Doig)" <legoist at GMAIL.COM> 08/01/05 10:10 PM >>>
  Below I have a snippet of a map file...  I get a blank image every
time I use the expression.  If I comment it out everything appears.  
When I run the query, I get data....  What's the problem here?  I've
tried Quotes, no Quotes, all sorts of iterations.

Help...


  DATA "the_geom from (SELECT the_geom,CASE WHEN cfcc IN
 ('A11','A12','A13','A14','A15','A16')
  THEN 'freeway' ELSE 'road' END as roadtype,cfcc,
  fename,oid FROM roads) as foo USING unique oid"
 TYPE LINE
         STATUS ON
         CLASS
         EXPRESSION "([roadtype] = 'freeway')"
          STYLE
                 COLOR 55 50 0
                 OUTLINECOLOR 200 200 200
                 SYMBOL 0
                 MINSIZE 3
                 SIZE 5
         END
         END
          CLASS
           EXPRESSION ([fename] = 'Monroe')
           STYLE
           COLOR 255 0 0
           OUTLINECOLOR 200 200 200
           SYMBOL 0
           SIZE 3
           END
         END



More information about the mapserver-users mailing list