<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><P>Below is a code snippet/////////////////////////////////</P>
<P>&nbsp;</P>
<P>$map_path="C:/Program Files/ms4w/apps/wms/";<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>$map = ms_newMapObj($map_path."ICWMS2.map");<BR>$map-&gt;setextent(586892.5,339611.094,593679.063,346206.156);<BR>&nbsp;<BR>$image=$map-&gt;draw();</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $layer = $map-&gt;getLayerByName('PARCELS');<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $status = $layer-&gt;open();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $status = $layer-&gt;whichShapes($map-&gt;extent);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while ($shape = $layer-&gt;nextShape()) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo $shape-&gt;toWkt();&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $layer-&gt;close();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $image_url=$image-&gt;saveWebImage();</P>
<P>echo(" &lt;IMG SRC=$image_url &gt;");</P>
<P>&nbsp;</P>
<P>////////////////////////////////////////////////////////////////////</P>
<P>&nbsp;</P>
<P>Below is the layer in the map file//////////////////</P>
<P>&nbsp;</P>
<P>LAYER<BR>&nbsp;TYPE POLYGON<BR>&nbsp;STATUS ON <BR>&nbsp;NAME "PARCELS"<BR>&nbsp;FILTERITEM "PIN"<BR>&nbsp;FILTER "84-035-40-001-00"<BR>&nbsp;DATA "Par.shp"<BR>&nbsp;CLASS<BR>&nbsp; STYLE<BR>&nbsp;&nbsp; OUTLINECOLOR 0 0 255<BR>&nbsp;&nbsp; SIZE 4<BR>&nbsp; END<BR>&nbsp;END<BR>END</P>
<P>&nbsp;</P>
<P>///////////////////////////////////////////////////////////////////</P>
<DIV>&nbsp;</DIV>
<DIV>If I remove the FILTER on the layer, the whichshapes code works correctly and returns all the shapes within the extent.</DIV>
<DIV>Let me know what you think.</DIV>
<DIV>Thanks.<BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR>
<DIV style="FONT-SIZE: 13px; FONT-FAMILY: arial, helvetica, sans-serif">----- Original Message ----<BR>From: Steve Lime &lt;Steve.Lime@dnr.state.mn.us&gt;<BR>To: mapserver-users@lists.osgeo.org; jjschlafley@yahoo.com<BR>Sent: Thursday, July 3, 2008 10:00:19 AM<BR>Subject: Re: [mapserver-users] Mapscript whichshapes attribute query<BR><BR>No, just setting the filter in the mapfile should suffice. Do you have a code snippet?<BR><BR>Steve<BR><BR>&gt;&gt;&gt; "J.J. Schlafley" &lt;<A href="mailto:jjschlafley@yahoo.com" ymailto="mailto:jjschlafley@yahoo.com">jjschlafley@yahoo.com</A>&gt; 07/03/08 8:51 AM &gt;&gt;&gt;<BR>If I have a FILTER and FILTERITEM set in my map file for a layer....when I call a whichshapes on that layer I get zero shapes.&nbsp; Comparatively, if I run a map draw, the FILTER works correctly and draws the shapes that meet the criteria.&nbsp; Do I need to use mapscript to set the filter or something? Thanks<BR><BR><BR><BR>----- Original
 Message ----<BR>From: Steve Lime &lt;<A href="mailto:Steve.Lime@dnr.state.mn.us" ymailto="mailto:Steve.Lime@dnr.state.mn.us">Steve.Lime@dnr.state.mn.us</A>&gt;<BR>To: <A href="mailto:mapserver-users@lists.osgeo.org" ymailto="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</A>; <A href="mailto:jjschlafley@yahoo.com" ymailto="mailto:jjschlafley@yahoo.com">jjschlafley@yahoo.com</A><BR>Sent: Wednesday, July 2, 2008 9:29:06 PM<BR>Subject: Re: [mapserver-users] Mapscript whichshapes attribute query<BR><BR>Which shapes applies the layer FILTER definition if it exists. That FILTER must be set prior to calling whichshapes.<BR><BR>Steve<BR><BR>&gt;&gt;&gt; "J.J. Schlafley" &lt;<A href="mailto:jjschlafley@yahoo.com" ymailto="mailto:jjschlafley@yahoo.com">jjschlafley@yahoo.com</A>&gt; 07/02/08 12:22 PM &gt;&gt;&gt;<BR>The mapscript documentation for the method (LayerObj) whichshapes claims you can quote: "Performs a spatial, and optionally
 an attribute based feature search."&nbsp; How and where is the attribute based search query included in this method? <BR>JJ<BR><BR><BR>&nbsp; &nbsp; &nbsp; <BR></DIV></DIV></div><br>

      </body></html>