Numeric Comparions in EXPRESSION Statements

James Card jdcard at INREACH.COM
Fri Oct 20 19:55:56 PDT 2006


On Wed, 18 Oct 2006 17:54:45 -0700, Stephen Woodbridge  
<woodbri at swoodbridge.com> wrote:

> Did you try:
>
> EXPRESSION ([STATIONS] >= 2 AND [STATIONS] <= 10)

Thanks! That works exactly like I wanted it to.

I've added a note to the "Expressions in MapServer" HowTo at <URL:  
http://mapserver.gis.umn.edu/docs/howto/msexpressions >:

   Values inside quotation marks are treated as strings. When string
   comparisons won't work -- for example, "EXPRESSION ('[SQFT]' >
   '4000' AND '[SQFT]' <= '10000')" -- and you need to compare
   numeric values, don't place quotation marks around the
   [ATTRIBUTENAME] nor around the literal values to be compared.
   This will provide a comparison of numeric values rather than
   string values: "EXPRESSION ([SQFT] > 4000 AND [SQFT] <= 10000)".

It might be helpful to have something similar added to the Mapfile  
Reference document.

-- 
James Card  --  <URL: http://home.inreach.com/jdcard/ >
Often there are several ways to understand a given set of
facts; some of them may be more useful than others.



More information about the MapServer-users mailing list