[mapserver-users] quotes in EXPRESSION, ATTRIBUTE type

Ted Spradley tspradley at snoogems.com
Sun Oct 25 11:49:28 PDT 2009


Hi all, hope your weekend is good!

Getting all of the Test Suite examples to function with my ver 5.4.1 of
MapServer.

1. Expressions can no longer be passed in the url correct? If attempted,
they are just ignored
    with 5.0+?

2. When using expressions in classes, we treat the expressions as 'regular'
SQL statements?
    i.e. If the ATTRIBUTE type is a string, we quote it, and if the type is
numeric we don't?
    
    The map excerpt below is from my modification of
/tests46/expressions/test.map.  The
    image renders as expected when I finally snapped to removing quote marks
from
    EXPRESSION ("[AREA]" > '%area%' ) (which did evaluate without error, but
was evidently
    making string comparison of the values)
.
.
.
  LAYER
    NAME counties_hilite
    DATA county
    STATUS ON
    TYPE POLYGON
    CLASS
        EXPRESSION ('%cty_fips%' = "[CTY_FIPS]")
        COLOR 255 255 0
    END
    CLASS
      EXPRESSION ([AREA] > %area% )
      COLOR 212 212 212      
    END
  END
.
.
.

3. When or when not to declare a CLASSITEM?  Only when inserting more than
one CLASS for 
    for the same attribute?  And its purpose is to basically make a
shorthand for the SQL statement
    in our EXPRESSION? e.g., 
        CLASSITEM 'NAME'
        CLASS
          EXPRESSION ('some name') # in lieu of EXPRESSION ("[NAME]" = 'some
name')
          COLOR 255 255 255
        END
        CLASS
          EXPRESSION ('some other name')
          COLOR 0 0 0
        END

Thanks in advance!  Enjoying this more every day!
Ted S. 


MapServer version 5.4.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=ICONV
SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER
SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=THREADS INPUT=EPPL7
INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE

-- 
View this message in context: http://n2.nabble.com/quotes-in-EXPRESSION-ATTRIBUTE-type-tp3888456p3888456.html
Sent from the Mapserver - User mailing list archive at Nabble.com.



More information about the MapServer-users mailing list