[mapserver-users] No filter defined on itemquery.

Ryan, Adam ARyan@co.linn.or.us
Tue, 11 Jun 2002 09:33:27 -0700


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_01C21165.B68D2E30
Content-Type: text/plain;
	charset="iso-8859-1"

I struggled through the same thing.  The solution is to set the layer's
filter and filteritem to your value and item respectively, but I don't
understand why either.  Watch for punctuation.
 
Adam  

-----Original Message-----
From: Martin, Daniel [mailto:DMartin@erac.com]
Sent: Tuesday, June 11, 2002 7:17 AM
To: 'mapserver-users@lists.gis.umn.edu'
Subject: [mapserver-users] No filter defined on itemquery.


When I try to itemquery a Postal Code layer, I get:
msQueryByAttributes(): Query error. Requested layer has no filter defined. 
 
My URL looks like this:
http://myserver/cgi-bin/mapserv.exe?map=d%3A%5CMapServer%5CMAPFiles%5CMOMap.
map&program=%2Fcgi-bin%2Fmapserv.exe&map_web_imagepath=d%3A%5Cinetpub%5Cwwwr
oot%5Ctemp%5C&map_web_imageurl=%2Ftemp%2F&mode=itemquery&value=63105&qlayer=
Zip+Codes&item=ZIP&mapext=shapes
 
I've included the layer definition at the bottom of this email.  I don't
understand.  Why do I need a filter?  What filter do I need?  I've read
everything about this I could find before asking you, but the documentation
on FILTER is very brief, and the mail archives didn't provide a solution.  I
should point out that I'm using OGR MapInfo TAB data.
 
Thanks in advance,
Dan Martin
 
 
LAYER
  NAME "Zip Codes"
  PROJECTION
    "proj=latlong"
  END
 
  CONNECTIONTYPE OGR
  CONNECTION "\GISData\Namerca\USA\Usa_Maps\USZIPBdy.TAB"
 
  TYPE POLYGON
  STATUS OFF
 LABELITEM "ZIP"
  CLASS
    SYMBOL 'circle'
    SIZE 2
    NAME 'ZIP Code Boundaries'
    OUTLINECOLOR 50 50 50 
    COLOR -1 -1 -1
  LABEL
      POSITION cc
      TYPE TRUETYPE
      FONT arial_narrow
      MINSIZE 8
      MAXSIZE 12
      COLOR 0 0 0
      OUTLINECOLOR 255 255 255
      ANTIALIAS true
   END
  END
  TEMPLATE "..\queryTemplates\US_ZIP_Code_query.html"
END


------_=_NextPart_001_01C21165.B68D2E30
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">


<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR></HEAD>
<BODY>
<DIV><SPAN class=3D107034216-11062002><FONT face=3DArial =
color=3D#0000ff size=3D2>I=20
struggled through the same thing.&nbsp; The solution is&nbsp;to set the =
layer's=20
filter and filteritem&nbsp;to your&nbsp;value and item respectively, =
but I don't=20
understand why either.&nbsp; Watch for punctuation.</FONT></SPAN></DIV>
<DIV><SPAN class=3D107034216-11062002><FONT face=3DArial =
color=3D#0000ff=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D107034216-11062002><FONT face=3DArial =
color=3D#0000ff=20
size=3D2>Adam&nbsp; </FONT></SPAN></DIV>
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
  <DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
face=3DTahoma=20
  size=3D2>-----Original Message-----<BR><B>From:</B> Martin, Daniel=20
  [mailto:DMartin@erac.com]<BR><B>Sent:</B> Tuesday, June 11, 2002 7:17 =

  AM<BR><B>To:</B> =
'mapserver-users@lists.gis.umn.edu'<BR><B>Subject:</B>=20
  [mapserver-users] No filter defined on =
itemquery.<BR><BR></FONT></DIV>
  <DIV><SPAN class=3D581251014-11062002><FONT face=3DArial =
size=3D2>When I try to=20
  itemquery a Postal Code layer, I get:</FONT></SPAN></DIV>
  <DIV><SPAN class=3D581251014-11062002>msQueryByAttributes(): Query =
error.=20
  Requested layer has no filter defined. </SPAN></DIV>
  <DIV><SPAN class=3D581251014-11062002><FONT face=3DArial=20
  size=3D2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=3D581251014-11062002><FONT face=3DArial size=3D2>My =
URL looks like=20
  this:</FONT></SPAN></DIV>
  <DIV><SPAN class=3D581251014-11062002><FONT face=3DArial size=3D2><A=20
  =
href=3D"http://myserver/cgi-bin/mapserv.exe?map=3Dd%3A%5CMapServer%5CMAP=
Files%5CMOMap.map&amp;program=3D%2Fcgi-bin%2Fmapserv.exe&amp;map_web_ima=
gepath=3Dd%3A%5Cinetpub%5Cwwwroot%5Ctemp%5C&amp;map_web_imageurl=3D%2Fte=
mp%2F&amp;mode=3Ditemquery&amp;value=3D63105&amp;qlayer=3DZip+Codes&amp;=
item=3DZIP&amp;mapext=3Dshapes">http://myserver/cgi-bin/mapserv.exe?map=3D=
d%3A%5CMapServer%5CMAPFiles%5CMOMap.map&amp;program=3D%2Fcgi-bin%2Fmapse=
rv.exe&amp;map_web_imagepath=3Dd%3A%5Cinetpub%5Cwwwroot%5Ctemp%5C&amp;ma=
p_web_imageurl=3D%2Ftemp%2F&amp;mode=3Ditemquery&amp;value=3D63105&amp;q=
layer=3DZip+Codes&amp;item=3DZIP&amp;mapext=3Dshapes</A></FONT></SPAN></=
DIV>
  <DIV><SPAN class=3D581251014-11062002><FONT face=3DArial=20
  size=3D2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=3D581251014-11062002><FONT face=3DArial =
size=3D2>I've included the=20
  layer definition at the bottom of this email.&nbsp; I don't =
understand.&nbsp;=20
  Why do I need a filter?&nbsp; What filter do I need?&nbsp; I've read=20
  everything about this I could find before asking you, but the =
documentation on=20
  FILTER is very brief, and the mail archives didn't provide a =
solution.&nbsp; I=20
  should point out that I'm using OGR&nbsp;MapInfo TAB =
data.</FONT></SPAN></DIV>
  <DIV><SPAN class=3D581251014-11062002></SPAN><SPAN=20
  class=3D581251014-11062002></SPAN><SPAN =
class=3D581251014-11062002></SPAN><SPAN=20
  class=3D581251014-11062002><FONT face=3DArial =
size=3D2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=3D581251014-11062002><FONT face=3DArial =
size=3D2>Thanks in=20
  advance,</FONT></SPAN></DIV>
  <DIV><SPAN class=3D581251014-11062002><FONT face=3DArial size=3D2>Dan =

  Martin</FONT></SPAN></DIV>
  <DIV><SPAN class=3D581251014-11062002><FONT face=3DArial=20
  size=3D2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=3D581251014-11062002><FONT face=3DArial=20
  size=3D2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=3D581251014-11062002><FONT face=3DArial =
size=3D2>LAYER<BR>&nbsp;=20
  NAME "Zip Codes"<BR>&nbsp; PROJECTION<BR>&nbsp;&nbsp;&nbsp;=20
  "proj=3Dlatlong"<BR>&nbsp; END</FONT></SPAN></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><SPAN class=3D581251014-11062002><FONT face=3DArial =
size=3D2>&nbsp;=20
  CONNECTIONTYPE OGR<BR>&nbsp; CONNECTION=20
  "\GISData\Namerca\USA\Usa_Maps\USZIPBdy.TAB"</FONT></SPAN></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><SPAN class=3D581251014-11062002><FONT face=3DArial =
size=3D2>&nbsp; TYPE=20
  POLYGON<BR>&nbsp; STATUS OFF<BR>&nbsp;LABELITEM "ZIP"<BR>&nbsp;=20
  CLASS<BR>&nbsp;&nbsp;&nbsp; SYMBOL 'circle'<BR>&nbsp;&nbsp;&nbsp; =
SIZE=20
  2<BR>&nbsp;&nbsp;&nbsp; NAME 'ZIP Code =
Boundaries'<BR>&nbsp;&nbsp;&nbsp;=20
  OUTLINECOLOR 50 50 50 <BR>&nbsp;&nbsp;&nbsp; COLOR -1 -1=20
  -1<BR>&nbsp;&nbsp;LABEL<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; POSITION=20
  cc<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TYPE=20
  TRUETYPE<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FONT=20
  arial_narrow<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MINSIZE=20
  8<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MAXSIZE=20
  12<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; COLOR 0 0=20
  0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OUTLINECOLOR 255 255=20
  255<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ANTIALIAS=20
  true<BR>&nbsp;&nbsp;&nbsp;END<BR>&nbsp; END<BR>&nbsp; TEMPLATE=20
  =
"..\queryTemplates\US_ZIP_Code_query.html"<BR>END</FONT></SPAN></DIV></B=
LOCKQUOTE></BODY></HTML>

------_=_NextPart_001_01C21165.B68D2E30--