<br><br><div class="gmail_quote">On Wed, Jul 8, 2009 at 8:56 PM, Steve Lime <span dir="ltr"><<a href="mailto:Steve.Lime@dnr.state.mn.us">Steve.Lime@dnr.state.mn.us</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
May well be a tolerance issue. By default it's in pixels and based on the extent you're setting (I don't<br>know what the map SIZE is set to) it's probably a super tiny value. Have you tried setting a tolerance<br>
in map units? E.g.<br><br> TOLERANCE 5<br> TOLERANCEUNITS meters # or whatever<br><br>Just an idea...<br><br>Steve<br><br>>>> On 7/8/2009 at 12:20 PM, in message<br><<a href="mailto:28aabd160907081020g1a1482f4mabdfe3c24d7472cc@mail.gmail.com">28aabd160907081020g1a1482f4mabdfe3c24d7472cc@mail.gmail.com</a>>, Hussain Hashmi<br>

<div>
<div></div>
<div class="h5"><<a href="mailto:tohashmi@gmail.com">tohashmi@gmail.com</a>> wrote:<br>> hi<br>><br>> Can someone here guide me on this issue please.<br>> 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.<br>><br>><br>> I am trying to query a street layer which gives me the following error.<br>><br>
> Warning: [MapServer Error]: msQueryByPoint(): No matching record(s) found in<br>> C:\... on line 84<br>> Warning: [MapServer Error]: msShapefileOpen():<br>> (/ms4w/maps/./city/./city/streets) in c:\... on line 84<br>
><br>><br>> MAPFILE<br>> **********************<br>>   LAYER<br>>     NAME 'streets_Query'<br>>     GROUP 'streets_Query'<br>>     DATA './city/streets'<br>>     TYPE line<br>
>     MAXSCALE 3001<br>>     STATUS ON<br>><br>>     TOLERANCE 5<br>>     TEMPLATE './_templates/Streets_Identify.html'<br>>     METADATA<br>>       "queryable" "true"<br>>        searchfield "ANAME"<br>
>        fields "ZIP_CODE"<br>>     END<br>>   END #end layer<br>><br>><br>><br>> PHP MAPSCRIPT<br>> **********************<br>> //------- Get Input Parameters.<br>> if (isset($_REQUEST['map']))    {$szMap = $_REQUEST['map'];} else {echo "map<br>
> not defined"; die;}<br>> if (isset($_REQUEST['coords'])) {$coords =<br>> explode(',',$_REQUEST['coords']);} else {echo "coordinate not defined";<br>> die;}<br>><br>><br>
> //------- Load Mapscript Module.<br>> $szPHPMapScriptModule = 'php_mapscript.'.PHP_SHLIB_SUFFIX;<br>> if (!extension_loaded('MapScript')) {<br>>  dl($szPHPMapScriptModule);<br>> }<br>><br>
> //------- Load Current Map file.<br>> $szMapFile=str_replace('<<Map>>',$szMap,'/ms4w/maps/<<Map>>.map');<br>> $oMap = ms_newMapObj($szMapFile);<br>><br>><br>> //------- SETTING MAP EXTENT to query extent..<br>
> $mapExtent = $oMap->extent;<br>> $oMap->setExtent($coords[0],$coords[1],<br>> $coords[0]+0.000001,$coords[1]+0.000001);<br>><br>> //------- SETTING QUERY POINT<br>> $point = ms_newPointObj();<br>
> $point->setXY($coords[0], $coords[1]);<br>><br>> //------- Initialize map query.<br>> $oMap->preparequery();<br>><br>> //------- LOOP ON LAYERS and get identify results.<br>> $tot = $oMap->numlayers;<br>
> for ($i = 0; $i < $tot; $i++) {<br>>    //------- get map layer.<br>>    $oLayer = $oMap->getLayer($i);<br>><br>>    //------- Verify Layer type<br>>    if ($oLayer->name != 'streets_Query') continue;<br>
><br>>    //------- Validate if query succeeds.<br>>    $check_query = $oLayer->queryByPoint($point, MS_SINGLE, 0);<br>>    if ($check_query != MS_SUCCESS) {continue;}<br>><br>>    //------- Open layer for data input.<br>
>     $oLayer->open();<br>><br>>    //------- Get the record values corresponding to a result tileindex.<br>>    $oResultCache = $oLayer->getResult(0);<br>>    $oShape = $oLayer->getShape($oResultCache->tileindex,<br>
> $oResultCache->shapeindex);<br>>    $aValues = $oShape->values;<br>><br>>    //------- Get the field value.<br>>    echo $aValues['ZIP_CODE'];  echo ";";<br>><br>>    //------- FREE SHAPE<br>
>    $oShape->free();<br>>    $oLayer->close();<br>>    break;<br>> } // for i<br>><br>><br>> Best regards,<br>> Mir Hashmi<br>><br>><br>><br>> ------------------------------<br>> This message may contain confidential and/or privileged information. If you<br>
> have received this message in error,please notify us immediately by<br>> responding to this e-mail and delete it from your system. Thanks for your<br>> cooperation.<br><br></div></div></blockquote></div><br>