[mapserver-users] Itemquery problem

Matthew Hatcher MJHatcher@space.qinetiq.com
Thu, 1 Aug 2002 11:47:06 +0100


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C23948.C74EE460
Content-Type: text/plain; charset="ISO-8859-1"

Hi all,
I'm having problems using the itemquery mode of Mapserver 3.6.1. I'm wanting
to have a text box which the user enters a postcode, which then queries a
shapefile containing postcode points. This then returns a query map of that
area. At least to start anyway.

Whatever I do and whatever is entered, itemquery returns the first record,
and itemnquery returns all the records.

What am I doing wrong? Any help would be appreciated, especially if it
includes examples of how to do it right!!

Matt Hatcher


<-- test.html -->
<html>
<body>
Enter postcode:

<form method="get" action="/cgi-bin/mapserv.exe">

<input type="hidden" name="map" value="test.map">
<input type="hidden" name="map_web_imagepath" value="\Inetpub\wwwroot\tmp\">
<input type="hidden" name="map_web_imageurl" value="/tmp/">
<input type="hidden" name="program" value="/cgi-bin/mapserv.exe">

<input type="hidden" name="mode" value="itemnquery">
<input type="hidden" name="qlayer" value="postcodes">
<input type="hidden" name="item" value="PCODE">
<input type="hidden" name="mapext" value="shapes">
<input type="hidden" name="buffer" value="1000">

<input type="text" name="value" size="10" value="">
<input type="submit" value="Go!">

</form>
</body>
</html>

<-- test.map (the relevant bits!) -->

QUERYMAP
  SIZE 300 300
  STATUS ON
  STYLE HILITE
  COLOR 255 0 0
END

LAYER
  NAME "postcodes"
  TYPE POINT
  STATUS OFF
  DATA postcodes

  TEMPLATE "query.html"
  FILTER "PCODE<>''"
  
  CLASS
    COLOR 192 192 192
    SYMBOL "circle"
    SIZE 3
  END
END

<-- end -->


**********************************************************************
The information contained in this email and any subsequent
 correspondence is private and is intended solely for the 
intended recipient(s). For those other than the intended
 recipient(s) any disclosure, copying, distribution, or any 
action taken or omitted to be taken in reliance on such 
information is prohibited and may be unlawful.
**********************************************************************


------_=_NextPart_001_01C23948.C74EE460
Content-Type: text/html; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; charset=3DISO-8859-=
1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version 5.5.2653.12">
<TITLE>Itemquery problem</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>Hi all,</FONT>
<BR><FONT SIZE=3D2>I'm having problems using the itemquery mode of Mapserve=
r 3.6.1. I'm wanting to have a text box which the user enters a postcode, w=
hich then queries a shapefile containing postcode points. This then returns=
 a query map of that area. At least to start anyway.</FONT></P>

<P><FONT SIZE=3D2>Whatever I do and whatever is entered, itemquery returns =
the first record, and itemnquery returns all the records.</FONT>
</P>

<P><FONT SIZE=3D2>What am I doing wrong? Any help would be appreciated, esp=
ecially if it includes examples of how to do it right!!</FONT>
</P>

<P><FONT SIZE=3D2>Matt Hatcher</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>&lt;-- test.html --&gt;</FONT>
<BR><FONT SIZE=3D2>&lt;html&gt;</FONT>
<BR><FONT SIZE=3D2>&lt;body&gt;</FONT>
<BR><FONT SIZE=3D2>Enter postcode:</FONT>
</P>

<P><FONT SIZE=3D2>&lt;form method=3D&quot;get&quot; action=3D&quot;/cgi-bin=
/mapserv.exe&quot;&gt;</FONT>
</P>

<P><FONT SIZE=3D2>&lt;input type=3D&quot;hidden&quot; name=3D&quot;map&quot=
; value=3D&quot;test.map&quot;&gt;</FONT>
<BR><FONT SIZE=3D2>&lt;input type=3D&quot;hidden&quot; name=3D&quot;map_web=
_imagepath&quot; value=3D&quot;\Inetpub\wwwroot\tmp\&quot;&gt;</FONT>
<BR><FONT SIZE=3D2>&lt;input type=3D&quot;hidden&quot; name=3D&quot;map_web=
_imageurl&quot; value=3D&quot;/tmp/&quot;&gt;</FONT>
<BR><FONT SIZE=3D2>&lt;input type=3D&quot;hidden&quot; name=3D&quot;program=
&quot; value=3D&quot;/cgi-bin/mapserv.exe&quot;&gt;</FONT>
</P>

<P><FONT SIZE=3D2>&lt;input type=3D&quot;hidden&quot; name=3D&quot;mode&quo=
t; value=3D&quot;itemnquery&quot;&gt;</FONT>
<BR><FONT SIZE=3D2>&lt;input type=3D&quot;hidden&quot; name=3D&quot;qlayer&=
quot; value=3D&quot;postcodes&quot;&gt;</FONT>
<BR><FONT SIZE=3D2>&lt;input type=3D&quot;hidden&quot; name=3D&quot;item&qu=
ot; value=3D&quot;PCODE&quot;&gt;</FONT>
<BR><FONT SIZE=3D2>&lt;input type=3D&quot;hidden&quot; name=3D&quot;mapext&=
quot; value=3D&quot;shapes&quot;&gt;</FONT>
<BR><FONT SIZE=3D2>&lt;input type=3D&quot;hidden&quot; name=3D&quot;buffer&=
quot; value=3D&quot;1000&quot;&gt;</FONT>
</P>

<P><FONT SIZE=3D2>&lt;input type=3D&quot;text&quot; name=3D&quot;value&quot=
; size=3D&quot;10&quot; value=3D&quot;&quot;&gt;</FONT>
<BR><FONT SIZE=3D2>&lt;input type=3D&quot;submit&quot; value=3D&quot;Go!&qu=
ot;&gt;</FONT>
</P>

<P><FONT SIZE=3D2>&lt;/form&gt;</FONT>
<BR><FONT SIZE=3D2>&lt;/body&gt;</FONT>
<BR><FONT SIZE=3D2>&lt;/html&gt;</FONT>
</P>

<P><FONT SIZE=3D2>&lt;-- test.map (the relevant bits!) --&gt;</FONT>
</P>

<P><FONT SIZE=3D2>QUERYMAP</FONT>
<BR><FONT SIZE=3D2>&nbsp; SIZE 300 300</FONT>
<BR><FONT SIZE=3D2>&nbsp; STATUS ON</FONT>
<BR><FONT SIZE=3D2>&nbsp; STYLE HILITE</FONT>
<BR><FONT SIZE=3D2>&nbsp; COLOR 255 0 0</FONT>
<BR><FONT SIZE=3D2>END</FONT>
</P>

<P><FONT SIZE=3D2>LAYER</FONT>
<BR><FONT SIZE=3D2>&nbsp; NAME &quot;postcodes&quot;</FONT>
<BR><FONT SIZE=3D2>&nbsp; TYPE POINT</FONT>
<BR><FONT SIZE=3D2>&nbsp; STATUS OFF</FONT>
<BR><FONT SIZE=3D2>&nbsp; DATA postcodes</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp; TEMPLATE &quot;query.html&quot;</FONT>
<BR><FONT SIZE=3D2>&nbsp; FILTER &quot;PCODE&lt;&gt;''&quot;</FONT>
<BR><FONT SIZE=3D2>&nbsp; </FONT>
<BR><FONT SIZE=3D2>&nbsp; CLASS</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; COLOR 192 192 192</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; SYMBOL &quot;circle&quot;</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; SIZE 3</FONT>
<BR><FONT SIZE=3D2>&nbsp; END</FONT>
<BR><FONT SIZE=3D2>END</FONT>
</P>

<P><FONT SIZE=3D2>&lt;-- end --&gt;</FONT>
</P>

<CODE><FONT SIZE=3D3><BR>
<BR>
**********************************************************************<BR>
The information contained in this email and any subsequent<BR>
 correspondence is private and is intended solely for the <BR>
intended recipient(s). For those other than the intended<BR>
 recipient(s) any disclosure, copying, distribution, or any <BR>
action taken or omitted to be taken in reliance on such <BR>
information is prohibited and may be unlawful.<BR>
**********************************************************************<BR>
</FONT></CODE>
</BODY>
</HTML>
------_=_NextPart_001_01C23948.C74EE460--