[mapserver-users] FILTER and FILTERITEM parameters in Map file

KRUSEMARK Matthew G matthew.g.krusemark at co.multnomah.or.us
Wed Oct 9 14:32:07 PDT 2002


Hi, 

Thanks to many folks for trying to help me out with my FILTER and FILTERITEM
params in my mapfile with 3.6.  So I tried to trouble-shoot with the
suggestions folks provided.  I am in a windows environment and I'm wondering
if my params with the 3.5 test suite are not working because of that or
because I have errored on syntax, not sure.  My map file, html query and
html template files are below if anyone wants to take one more look or test
in their windows environment.  

My error message:  msQueryByAttributes(): Search returned no results. No
matching record(s) found. 

My URL string for 3.3 cgi exe is the following and works just fine (but this
uses the QUERY param in the map file, no FILTERITEM or FILTER params): 

http://gisshare/cgi-bin/mapserv33.exe?map=D%3A%5CInetpub%5Cwwwroot%5Cgis 
share_web%5Cmapserver_demo36%5Citasca%5Ccase1.map&mode=itemquery&item=cty_na
me&value=Anoka 
 
My URL string for 3.6 cgi exe is the following (same but with qlayer in the
cgi and FILTERITEM and FILTER in map file) but does not work: 

http://gisshare/cgi-bin/mapserv.exe?map=D%3A%5CInetpub%5Cwwwroot%5Cgissh 
are_web%5Cmapserver_demo36%5Citasca%5Ccase1.map&mode=itemquery&qlayer=county
&item=cty_name&value=Anoka

****** MAPFILE BELOW ***********

MAP
  NAME test
  SHAPEPATH "D:\Inetpub\wwwroot\gisshare_web\mapserver_demo36\itasca\data"
  SIZE 300 300
  EXTENT 74000 4775000 798000 5499000

  QUERYMAP
    STATUS ON
    STYLE HILITE
    COLOR 255 255 0
  END

  LAYER
    NAME county
    DATA county
    STATUS DEFAULT
    TYPE POLYGON
    FILTERITEM cty_name
    FILTER "%cty_name%"
#    FILTER "name != 'Anoka'"
    CLASS      
      COLOR 212 212 212
      OUTLINECOLOR 0 0 0
      TEMPLATE case1_template.html
    END
  END

 
# 3.3 stuff below

#LAYER
#  NAME county
#  DATA county
#  STATUS DEFAULT
#  TYPE POLYGON  	
  
#  QUERY
#    TEMPLATE case1_template.html
#  END
#END

END 

******** HTML with Query below **********

<html>
<head>
  <title>ItemQuery Example</title>
</head>
<body bgcolor="#ffffff">
<font size="+1" face="arial,helvetica"><b>Case 1: Simple
ItemQuery</b></font>
<form method="get" action="/cgi-bin/mapserv.exe">

<input type="hidden" name="map"
value="D:\Inetpub\wwwroot\gisshare_web\mapserver_demo36\itasca\case1.map">
<input type="hidden" name="mode" value="itemquery">
<input type="hidden" name="qlayer" value="county">
<input type="hidden" name="item" value="cty_name">

Pick one:
<select name="value" size="1">
<option>  Aitkin
<option>  Anoka
<option>  Becker
</select>
<input type="submit" value="Go!">
</form>
</body>
</html>

********** HTML Template below ************

<html>
<head>
  <title>ItemQuery Example</title>
</head>
<body bgcolor="#ffffff">
<font size="+2" face="arial,helvetica"><b>Case 1: Simple
ItemQuery</b></font>
<p>

Dump of attributes from that county:
<p>
<b>Name:</b> [CTY_NAME]<br>
<b>ID Number:</b> [COUN]<br>
<b>Abbreviation Code:</b> [CTY_ABBR]<br>
</body>
</html>

Kind regards,-matthew



More information about the MapServer-users mailing list