<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial, helvetica, sans-serif;font-size:10pt"><div>You might want to check out the code for "query.php" in the GM2 branch.</div><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><div style="font-family:arial, helvetica, sans-serif;font-size:10pt"><br><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><font size="2" face="Tahoma"><b><span style="font-weight: bold;">From:</span></b> Jay Kapalczynski <jkapalczynski@ci.maple-grove.mn.us><br><b><span style="font-weight: bold;">To:</span></b> Emiliano Castañeda <emilianocastaneda@suremptec.com.ar><br><b><span style="font-weight: bold;">Cc:</span></b> "mapserver-users@lists.osgeo.org" <mapserver-users@lists.osgeo.org><br><b><span style="font-weight: bold;">Sent:</span></b> Thu, December 10, 2009 3:20:58
PM<br><b><span style="font-weight: bold;">Subject:</span></b> RE: [mapserver-users] Expression Syntax<br></font><br>
<style>
<!--
_filtered {font-family:"Cambria Math";panose-1:2 4 5 3 5 4 6 3 2 4;}
_filtered {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;}
_filtered {font-family:Tahoma;panose-1:2 11 6 4 3 5 4 4 2 4;}
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New Roman", "serif";}
a:link, span.MsoHyperlink
{color:blue;text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;text-decoration:underline;}
span.EmailStyle17
{font-family:"Calibri", "sans-serif";color:#1F497D;}
.MsoChpDefault
{}
_filtered {margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
{}
-->
</style>
<div class="Section1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri", "sans-serif";color:#1F497D;">Emiliano thanks for the response….yea I looked at the
documentation and it was a bit fuzzy to me…</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri", "sans-serif";color:#1F497D;"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri", "sans-serif";color:#1F497D;">If I do them individually it works:</span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Calibri", "sans-serif";color:#632423;"> #FILTERITEM 'USE1_DESC'</span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Calibri", "sans-serif";color:#632423;"> #FILTER /.*%idOwnerQueryDESC%.*/i</span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Calibri", "sans-serif";color:#632423;"> #FILTERITEM 'BLOCK'</span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Calibri", "sans-serif";color:#632423;"> #FILTER /.*%idOwnerQueryBLOCK%.*/i</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri", "sans-serif";color:#1F497D;"> </span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Calibri", "sans-serif";color:#632423;">FILTER ([USE1_DESC]=%idOwnerQueryDESC% AND
[BLOCK]=%idOwnerQueryBLOCK%)</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri", "sans-serif";color:#1F497D;">ERROR: msEvalExpression: Expression parser error. Failed to
parse expression: =Residential AND =006</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri", "sans-serif";color:#1F497D;"> </span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Calibri", "sans-serif";color:#632423;">FILTER (USE1_DESC=%idOwnerQueryDESC% AND
BLOCK=%idOwnerQueryBLOCK%)</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri", "sans-serif";color:#1F497D;">I seemed to get a bunch of returns that were incorrect...seems
like it grabbed all of them.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri", "sans-serif";color:#1F497D;"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri", "sans-serif";color:#1F497D;">Thoughts?</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri", "sans-serif";color:#1F497D;"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri", "sans-serif";color:#1F497D;"> </span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in;">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma", "sans-serif";">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma", "sans-serif";"> Emiliano Castañeda
[mailto:emilianocastaneda@suremptec.com.ar] <br>
<b>Sent:</b> Thursday, December 10, 2009 2:13 PM<br>
<b>To:</b> Jay Kapalczynski<br>
<b>Cc:</b> mapserver-users@lists.osgeo.org<br>
<b>Subject:</b> Re: [mapserver-users] Expression Syntax</span></p>
</div>
<p class="MsoNormal"> </p>
<div>
<p class="MsoNormal">Jay,</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">you must use FILTERITEM only for simple FILTER expressions
(string comparison only)</p>
</div>
<div>
<p class="MsoNormal">for example: </p>
</div>
<div>
<p class="MsoNormal">FILTER "2005" ->fieldvalue<br>
FILTERITEM "year" ->fieldname</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">For Logical FILTER expressions you do not define
FILTERITEM. In this case you must place the FILTER between parentheses,
and fieldnames between brackets </p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">for example:</p>
</div>
<div>
<p class="MsoNormal">FILTER ([field1]<4000 AND
"[field2]"=="Museum") -->observe quotes on both sides on
text fields</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal"><span>See <a target="_blank" href="http://mapserver.org/mapfile/expressions.html#expressions">http://mapserver.org/mapfile/expressions.html#expressions</a> for
detail on how to build logical expressions</span></p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">Regards,</p>
</div>
<div>
<p class="MsoNormal">Emiliano</p>
</div>
<div>
<p class="MsoNormal">2009/12/10 Jay Kapalczynski <<a rel="nofollow" ymailto="mailto:jkapalczynski@ci.maple-grove.mn.us" target="_blank" href="mailto:jkapalczynski@ci.maple-grove.mn.us">jkapalczynski@ci.maple-grove.mn.us</a>></p>
<div>
<div>
<p class="MsoNormal" style="">I
looked on map server website in the documentation and cant get the synstax
correct</p>
<p class="MsoNormal" style=""> </p>
<p class="MsoNormal" style="">I
have two textboxes idOwner and idOwner2</p>
<p class="MsoNormal" style="">I
am a bit confused on the FILTERITEM because I am trying to write the expression
to include two fields.</p>
<p class="MsoNormal" style=""> </p>
<p class="MsoNormal" style="">USE1_DESC
and BLOCK are the two fields that form the query</p>
<p class="MsoNormal" style=""> </p>
<p class="MsoNormal" style=""><span style="font-size:9.0pt;color:#632423;"> LAYER # Parcels Owner Layer</span></p>
<p class="MsoNormal" style=""><span style="font-size:9.0pt;color:#632423;">
NAME 'Parcels'</span></p>
<p class="MsoNormal" style=""><span style="font-size:9.0pt;color:#632423;">
DATA 'parcels/parcels.shp'</span></p>
<p class="MsoNormal" style=""><span style="font-size:9.0pt;color:#632423;">
STATUS DEFAULT</span></p>
<p class="MsoNormal" style=""><span style="font-size:9.0pt;color:#632423;">
TYPE POLYGON</span></p>
<p class="MsoNormal" style=""><span style="font-size:9.0pt;color:#632423;">
METADATA</span></p>
<p class="MsoNormal" style=""><span style="font-size:9.0pt;color:#632423;">
qstring_validation_pattern '.'</span></p>
<p class="MsoNormal" style=""><span style="font-size:9.0pt;color:#632423;">
END</span></p>
<p class="MsoNormal" style=""><span style="font-size:9.0pt;color:#632423;">
TEMPLATE 'parcels/itemquery_parcels_Owner.html'</span></p>
<p class="MsoNormal" style=""><span style="font-size:9.0pt;color:#632423;"> </span></p>
<p class="MsoNormal" style=""><span style="font-size:9.0pt;color:#632423;">
FILTERITEM 'USE1_DESC'</span></p>
<p class="MsoNormal" style=""><span style="font-size:9.0pt;color:#632423;"> </span></p>
<p class="MsoNormal" style=""><span style="font-size:9.0pt;color:#632423;">
FILTER (* WHERE USE1_DESC = '%idOwner%' and BLOCK =
'%idOwner2%') </span></p>
<p class="MsoNormal" style=""><span style="font-size:9.0pt;color:#632423;"> </span></p>
<p class="MsoNormal" style=""><span style="font-size:9.0pt;color:#632423;"> END </span></p>
<p class="MsoNormal" style=""> </p>
<p class="MsoNormal" style=""> </p>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt;"><br>
_______________________________________________<br>
mapserver-users mailing list<br>
<a rel="nofollow" ymailto="mailto:mapserver-users@lists.osgeo.org" target="_blank" href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br><span>
<a target="_blank" href="http://lists.osgeo.org/mailman/listinfo/mapserver-users">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a></span></p>
</div>
<p class="MsoNormal"><br>
<br clear="all">
<br>
-- <br>
Ing. Emiliano Castañeda<br>
SUR Emprendimientos Tecnológicos<br>
<br>
Ing. Huergo 1189 (C1007AOL)<br>
Ciudad de Buenos Aires, Argentina<br>
Tel. +54 (11) 5811-4552 ext. 107<br>
<a rel="nofollow" ymailto="mailto:emilianocastaneda@suremptec.com.ar" target="_blank" href="mailto:emilianocastaneda@suremptec.com.ar">emilianocastaneda@suremptec.com.ar</a><br>
<a rel="nofollow" target="_blank" href="http://www.suremptec.com">www.suremptec.com</a></p>
</div>
</div></div></blockquote><div style="position:fixed"></div>
<!-- cg24.c2.mail.ac4.yahoo.com compressed/chunked Tue Dec 8 17:30:36 PST 2009 -->
</div><br>
</body></html>