<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> </P>
<P>$map_path="C:/Program Files/ms4w/apps/wms/";<BR>        <BR>$map = ms_newMapObj($map_path."ICWMS2.map");<BR>$map->setextent(586892.5,339611.094,593679.063,346206.156);<BR> <BR>$image=$map->draw();</P>
<P>       $layer = $map->getLayerByName('PARCELS');<BR>       $status = $layer->open();<BR>       <BR>       $status = $layer->whichShapes($map->extent);<BR>       while ($shape = $layer->nextShape()) <BR>           {<BR>             <BR>             echo $shape->toWkt();   <BR>             <BR>           }<BR>       $layer->close();<BR>       <BR>       $image_url=$image->saveWebImage();</P>
<P>echo(" <IMG SRC=$image_url >");</P>
<P> </P>
<P>////////////////////////////////////////////////////////////////////</P>
<P> </P>
<P>Below is the layer in the map file//////////////////</P>
<P> </P>
<P>LAYER<BR> TYPE POLYGON<BR> STATUS ON <BR> NAME "PARCELS"<BR> FILTERITEM "PIN"<BR> FILTER "84-035-40-001-00"<BR> DATA "Par.shp"<BR> CLASS<BR>  STYLE<BR>   OUTLINECOLOR 0 0 255<BR>   SIZE 4<BR>  END<BR> END<BR>END</P>
<P> </P>
<P>///////////////////////////////////////////////////////////////////</P>
<DIV> </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 <Steve.Lime@dnr.state.mn.us><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>>>> "J.J. Schlafley" <<A href="mailto:jjschlafley@yahoo.com" ymailto="mailto:jjschlafley@yahoo.com">jjschlafley@yahoo.com</A>> 07/03/08 8:51 AM >>><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.  Comparatively, if I run a map draw, the FILTER works correctly and draws the shapes that meet the criteria.  Do I need to use mapscript to set the filter or something? Thanks<BR><BR><BR><BR>----- Original
 Message ----<BR>From: Steve Lime <<A href="mailto:Steve.Lime@dnr.state.mn.us" ymailto="mailto:Steve.Lime@dnr.state.mn.us">Steve.Lime@dnr.state.mn.us</A>><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>>>> "J.J. Schlafley" <<A href="mailto:jjschlafley@yahoo.com" ymailto="mailto:jjschlafley@yahoo.com">jjschlafley@yahoo.com</A>> 07/02/08 12:22 PM >>><BR>The mapscript documentation for the method (LayerObj) whichshapes claims you can quote: "Performs a spatial, and optionally
 an attribute based feature search."  How and where is the attribute based search query included in this method? <BR>JJ<BR><BR><BR>      <BR></DIV></DIV></div><br>

      </body></html>