[mapserver-users] Expression Syntax

Dan Little danlittle at yahoo.com
Thu Dec 10 16:25:15 EST 2009


You might want to check out the code for "query.php" in the GM2 branch.

>
>From: Jay Kapalczynski <jkapalczynski at ci.maple-grove.mn.us>
>To: Emiliano Castañeda <emilianocastaneda at suremptec.com.ar>
>Cc: "mapserver-users at lists.osgeo.org" <mapserver-users at lists.osgeo.org>
>Sent: Thu, December 10, 2009 3:20:58 PM
>Subject: RE: [mapserver-users] Expression Syntax
>
> >
>>
>Emiliano thanks for the response….yea I looked at the
>documentation and it was a bit fuzzy to me…
> 
>If I do them individually it works:
>                #FILTERITEM 'USE1_DESC'
>                #FILTER /.*%idOwnerQueryDESC%.*/i
>                #FILTERITEM 'BLOCK'
>                #FILTER /.*%idOwnerQueryBLOCK%.*/i
> 
>FILTER ([USE1_DESC]=%idOwnerQueryDESC% AND
>[BLOCK]=%idOwnerQueryBLOCK%)
>ERROR: msEvalExpression: Expression parser error.  Failed to
>parse expression: =Residential AND  =006
> 
>FILTER (USE1_DESC=%idOwnerQueryDESC% AND
>BLOCK=%idOwnerQueryBLOCK%)
>I seemed to get a bunch of returns that were incorrect...seems
>like it grabbed all of them.
> 
>Thoughts?
> 
> 
>>
>From:Emiliano Castañeda
>[mailto:emilianocastaneda at suremptec.com.ar] 
>Sent: Thursday, December 10, 2009 2:13 PM
>To: Jay Kapalczynski
>Cc: mapserver-users at lists.osgeo.org
>Subject: Re: [mapserver-users] Expression Syntax
> 
>>
>Jay,
>>
> 
>>
>you must use FILTERITEM only for simple FILTER expressions
>(string comparison only)
>>
>for example: 
>>
>FILTER "2005" ->fieldvalue
>>FILTERITEM "year" ->fieldname
>>
> 
>>
>For Logical FILTER expressions you do not define
>FILTERITEM. In this case you must place the FILTER between parentheses,
>and fieldnames between brackets 
>>
> 
>>
>for example:
>>
>FILTER ([field1]<4000 AND
>"[field2]"=="Museum") -->observe quotes on both sides on
>text fields
>>
> 
>>
>See http://mapserver.org/mapfile/expressions.html#expressions for
>detail on how to build logical expressions
>>
> 
>>
>Regards,
>>
>Emiliano
>>
>2009/12/10 Jay Kapalczynski <jkapalczynski at ci.maple-grove.mn.us>
>>
>>
>I
>looked on map server website in the documentation and cant get the synstax
>correct
> 
>I
>have two textboxes idOwner and idOwner2
>I
>am a bit confused on the FILTERITEM because I am trying to write the expression
>to include two fields.
> 
>USE1_DESC
>and BLOCK are the two fields that form the query
> 
>  LAYER # Parcels Owner Layer
>               
>    NAME 'Parcels'
>               
>    DATA 'parcels/parcels.shp'
>               
>    STATUS DEFAULT
>               
>    TYPE POLYGON
>               
>    METADATA
>               
>   
>           
>qstring_validation_pattern '.'
>               
>    END
>               
>    TEMPLATE 'parcels/itemquery_parcels_Owner.html'
> 
>               
>    FILTERITEM 'USE1_DESC'
> 
>               
>    FILTER (* WHERE USE1_DESC = '%idOwner%' and BLOCK =
>'%idOwner2%') 
> 
>  END  
> 
> 
>
>>_______________________________________________
>>mapserver-users mailing list
>mapserver-users at lists.osgeo.org
>http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>
>
>>-- 
>>Ing. Emiliano Castañeda
>>SUR Emprendimientos Tecnológicos
>
>>Ing. Huergo 1189 (C1007AOL)
>>Ciudad de Buenos Aires, Argentina
>>Tel. +54 (11) 5811-4552   ext. 107
>emilianocastaneda at suremptec.com.ar
>www.suremptec.com


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20091210/2d056a98/attachment.html


More information about the mapserver-users mailing list