<div dir="ltr"><div>hi</div>
<div> </div>
<div>Can someone here guide me on this issue please.<br></div>
<div>My Objective is to get attribute values for any selected street (Line).<br>My client application is based on KaMap.<br>I have a similar solution for Polygons which works perfectly.  </div>
<div class="gmail_quote">
<div lang="EN-US" link="blue" vlink="purple">
<div>
<p><br>I am trying to query a street layer which gives me the following error. </p>
<p>Warning: [MapServer Error]: msQueryByPoint(): No matching record(s) found in C:\... on line 84<br>Warning: [MapServer Error]: msShapefileOpen(): (/ms4w/maps/./city/./city/streets) in c:\... on line 84</p>
<p><br>MAPFILE<br>**********************<br>  LAYER<br>    NAME &#39;streets_Query&#39;<br>    GROUP &#39;streets_Query&#39;<br>    DATA &#39;./city/streets&#39;<br>    TYPE line<br>    MAXSCALE 3001<br>    STATUS ON</p>

<p>    TOLERANCE 5<br>    TEMPLATE &#39;./_templates/Streets_Identify.html&#39;<br>    METADATA<br>      &quot;queryable&quot; &quot;true&quot;<br>       searchfield &quot;ANAME&quot;<br>       fields &quot;ZIP_CODE&quot;<br>
    END<br>  END #end layer</p>
<p> </p>
<p>PHP MAPSCRIPT<br>**********************<br>//------- Get Input Parameters.<br>if (isset($_REQUEST[&#39;map&#39;]))    {$szMap = $_REQUEST[&#39;map&#39;];} else {echo &quot;map not defined&quot;; die;}<br>if (isset($_REQUEST[&#39;coords&#39;])) {$coords = explode(&#39;,&#39;,$_REQUEST[&#39;coords&#39;]);} else {echo &quot;coordinate not defined&quot;; die;}</p>

<p><br>//------- Load Mapscript Module.<br>$szPHPMapScriptModule = &#39;php_mapscript.&#39;.PHP_SHLIB_SUFFIX;<br>if (!extension_loaded(&#39;MapScript&#39;)) {<br> dl($szPHPMapScriptModule);<br>}</p>
<p>//------- Load Current Map file.<br>$szMapFile=str_replace(&#39;&lt;&lt;Map&gt;&gt;&#39;,$szMap,&#39;/ms4w/maps/&lt;&lt;Map&gt;&gt;.map&#39;);<br>$oMap = ms_newMapObj($szMapFile);</p>
<p><br>//------- SETTING MAP EXTENT to query extent.. <br>$mapExtent = $oMap-&gt;extent;<br>$oMap-&gt;setExtent($coords[0],$coords[1], $coords[0]+0.000001,$coords[1]+0.000001);</p>
<p>//------- SETTING QUERY POINT<br>$point = ms_newPointObj();<br>$point-&gt;setXY($coords[0], $coords[1]);</p>
<p>//------- Initialize map query.<br>$oMap-&gt;preparequery();</p>
<p>//------- LOOP ON LAYERS and get identify results.<br>$tot = $oMap-&gt;numlayers;<br>for ($i = 0; $i &lt; $tot; $i++) {<br>   //------- get map layer.<br>   $oLayer = $oMap-&gt;getLayer($i);</p>
<p>   //------- Verify Layer type<br>   if ($oLayer-&gt;name != &#39;streets_Query&#39;) continue;</p>
<p>   //------- Validate if query succeeds.<br>   $check_query = $oLayer-&gt;queryByPoint($point, MS_SINGLE, 0);  <br>   if ($check_query != MS_SUCCESS) {continue;}</p>
<p>   //------- Open layer for data input. <br>    $oLayer-&gt;open();</p>
<p>   //------- Get the record values corresponding to a result tileindex.<br>   $oResultCache = $oLayer-&gt;getResult(0);<br>   $oShape = $oLayer-&gt;getShape($oResultCache-&gt;tileindex, $oResultCache-&gt;shapeindex);<br>
   $aValues = $oShape-&gt;values;</p>
<p>   //------- Get the field value.<br>   echo $aValues[&#39;ZIP_CODE&#39;];  echo &quot;;&quot;;<br>   <br>   //------- FREE SHAPE  <br>   $oShape-&gt;free();<br>   $oLayer-&gt;close();<br>   break; <br>} // for i</p>
<p><br>Best regards,<br>Mir Hashmi<span style="FONT-SIZE: 8pt; COLOR: #606060"></span></p>
<p> </p></div><br>
<hr>
<font face="Arial" color="gray" size="1">This message may contain confidential and/or privileged information. If you have received this message in error,please notify us immediately by responding to this e-mail and delete it from your system. Thanks for your cooperation.<br>
</font></div></div><br></div>