<HTML>
<style> BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; }</style>Hi Frank, Alexander,<br>

<br>

Again thanks for your reply; I've been abroad for a month and haven't 
had time to check it out. However, I've ben doing some work on it today,
 and tested the following:<br>

<br>

I made a test tiff, with 2 large areas surrounded by NoData. When 
clicking anywhere in any one of the 2 big areas I get the response:<br>

<code class="wrappedText focusRow" role="listitem"><br>

{"_handle_":Resource id #47,"numlines":1,"type":0,"index":-1,"tileindex"</code><code class="wrappedText focusRow" role="listitem">:-1,"classindex":0,"numvalues":8,"text":"","bounds":{"_handle_":Resource
 id #48,"minx":401265.0032,"miny"</code><code class="wrappedText 
focusRow" role="listitem">:633815.31,"maxx":401265.0032,"maxy":633815.31},"values":[null,null,null,null,null,null,null,null]}<br>

</code><br>

When I click on any nodata area the response is&nbsp;
<pre role="list">Warning: [MapServer Error]: msQueryByPoint(): No matching record(s) found. in C:\ms4w\apps\fusion\MapServer\php\GetRasterPoint.php on line 36<br>
Fatal error: [MapServer Error]: msRASTERLayerGetShape(): Out of range shape index requested. Requested 0 but only 0 shapes available. in C:\ms4w\apps\fusion\MapServer\php\GetRasterPoint.php on line 42<br>
<br>
<span style="font-family: Arial;">This behaviour follows the edges of the areas perfectly. Also I checked it out with fixed coord pairs, and it doesn't seem te related to CRS problems. I've also tried IMG instead of TIFF, but no difference there.<br>
<br>
As mentioned, I'm running mapscript 5.2.1, not 5.6. I'm don't know if this would make a difference, but perhaps someone could test this for me? <br>
<br>
The TIFF I use for testing is available from:  </span><style> BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; }</style>http://www.vdputte.nl/test_tiff.rar</pre>
 *** For the MAP part of the mapfile, I use the following (I removed most non-essential things):<br>
&nbsp;&nbsp;&nbsp; EXTENT -1000000 -1200000 2902206 1773859<br>
&nbsp;&nbsp;&nbsp; IMAGETYPE PNG24<br>
&nbsp;&nbsp;&nbsp; SIZE 600 600<br>
&nbsp;&nbsp;&nbsp; STATUS ON<br>
&nbsp;&nbsp;&nbsp; UNITS METERS<br>
&nbsp;&nbsp;&nbsp; NAME "Test_Map"<br>
<br>
&nbsp;&nbsp;&nbsp; PROJECTION<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 'proj=lcc'<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 'lat_1=52.67000000000002'<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 'lat_2=54.33'<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 'lat_0=48'<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 'lon_0=10'<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 'x_0=815000'<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 'y_0=0'<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 'ellps=intl'<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 'units=m'<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 'no_defs'<br>
&nbsp;&nbsp;&nbsp; END<br>
<br>
*** For the test LAYER:<br>
<br>
&nbsp;&nbsp;&nbsp; LAYER<br>
&nbsp;&nbsp;&nbsp; &nbsp; NAME "mask"<br>
&nbsp;&nbsp;&nbsp; &nbsp; DATA "c:/ms4w/Apache/htdocs/data/rasters/depthmaps/tert_msk_rast.img"<br>
&nbsp;&nbsp;&nbsp; &nbsp; TYPE RASTER<br>
&nbsp;&nbsp;&nbsp; &nbsp; STATUS ON<br>
&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; LAYER TEMPLATE "dummy.html"<br>
&nbsp;&nbsp;&nbsp; &nbsp; CLASS<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; NAME "1"<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; EXPRESSION ([pixel] == 1)<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; STYLE<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; color 255 0 0 <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; END&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp; END<br>
&nbsp;&nbsp;&nbsp; &nbsp; CLASS<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; NAME "2"<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; EXPRESSION ([pixel] == 2)<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; STYLE<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; color 0 255 0 <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; END&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp; END<br>
&nbsp;&nbsp;&nbsp; END#layer<br>
<br>
*** For the querying script I use this:<br>
<br>
$szLayer = "mask"; <br>
$oLayer = $oMap-&gt;getLayerByName($szLayer); //get Layer<br>
$oMap-&gt;prepareQuery();<br>
<br>
// To be sure no CRS problems arise, I use these coords, smack in the middle of the left area<br>
$x = 360429;<br>
$y = 642536;<br>
<br>
/* <br>
//For NoData, use<span style="font-family: Arial,Helvetica,sans-serif;"><br>
$</span>x = 759753;<span style="font-family: monospace;"><br>
</span>$y = <code class="wrappedText focusRow" role="listitem">935658;<br>
// for a point right between the 2 areas<br>
</code><span style="font-family: monospace;"></span>*/<br>
<br>
$oPoint = ms_newPointObj(); //Create Point<br>
$oPoint-&gt;setXY($x,$y);<br>
<br>
$status = $oLayer-&gt;queryByPoint($oPoint, MS_MULTIPLE, 1); //Query<br>
$status = $oLayer-&gt;open();<br>
$result = $oLayer-&gt;getResult(0); //Get Result<br>
$numResults = $oLayer-&gt;getNumResults();<br>
<br>
$shape = $oLayer-&gt;getShape($result-&gt;shapeindex,$result-&gt;tileindex); // Retrieve shape<br>
<br>
echo(var2json($shape)); //echo to browser<br>
<br>
<br>
Can anybody confirm that they get the same behaviour?<br>
<br>
Cheers,<br>
Tom<br>
<br>
<br>
<br>
<span style="font-weight: bold;">On Thu 29/04/10 16:07 , Frank Warmerdam warmerdam@pobox.com sent:<br>
</span><blockquote style="border-left: 2px solid rgb(245, 245, 245); margin-left: 5px; margin-right: 0px; padding-left: 5px; padding-right: 0px;">Tom van der Putte wrote:<br>

<span style="color: rgb(102, 102, 102);">&gt; Hi,</span><br>

<span style="color: rgb(102, 102, 102);">&gt; </span><br>

<span style="color: rgb(102, 102, 102);">&gt; I have the following code:</span><br>

<span style="color: rgb(102, 102, 102);">&gt; </span><br>

<span style="color: rgb(102, 102, 102);">&gt; $oMap-&gt;prepareQuery();</span><br>

<span style="color: rgb(102, 102, 102);">&gt; $oPoint = ms_newPointObj();</span><br>

<span style="color: rgb(102, 102, 102);">&gt; $oPoint-&gt;setXY($x,$y);   //coords received from a AJAX call</span><br>

<span style="color: rgb(102, 102, 102);">&gt; </span><br>

<span style="color: rgb(102, 102, 102);">&gt; </span><br>

<span style="color: rgb(102, 102, 102);">&gt; $oLayer = $oMap-&gt;GetLayerByName($szLayer); //Name received from a AJAX call</span><br>

<span style="color: rgb(102, 102, 102);">&gt; $status = $oLayer-&gt;queryByPoint($oPoint, MS_MULTIPLE, 1);</span><br>

<span style="color: rgb(102, 102, 102);">&gt; $status = $oLayer-&gt;open();</span><br>

<span style="color: rgb(102, 102, 102);">&gt; $result = $oLayer-&gt;getResult(0);</span><br>

<span style="color: rgb(102, 102, 102);">&gt; $numResults = $oLayer-&gt;getNumResults();</span><br>

<span style="color: rgb(102, 102, 102);">&gt; $shape = $oLayer-&gt;getShape($result-&gt;shapeindex,$result-&gt;tileindex);</span><br>

<span style="color: rgb(102, 102, 102);">&gt; echo(var2json($shape));</span><br>

<span style="color: rgb(102, 102, 102);">&gt; </span><br>

<span style="color: rgb(102, 102, 102);">&gt; This results in the follwing json code to be returned:</span><br>

<span style="color: rgb(102, 102, 102);">&gt; </span><br>

<span style="color: rgb(102, 102, 102);">&gt; |{"_handle_":Resource id #45,"numlines":1,"type":0,"index":-1,</span><br>

<span style="color: rgb(102, 102, 102);">&gt; </span><br>

<span style="color: rgb(102, 102, 102);">&gt; "tileindex":-1,"classindex":0,"numvalues":8,"text":"",</span><br>

<span style="color: rgb(102, 102, 102);">&gt; </span><br>

<span style="color: rgb(102, 102, 102);">&gt; "bounds":{"_handle_":Resource id #46,"minx":607000,</span><br>

<span style="color: rgb(102, 102, 102);">&gt; </span><br>

<span style="color: rgb(102, 102, 102);">&gt; "miny":677000,"maxx":607000,"maxy":677000},</span><br>

<span style="color: rgb(102, 102, 102);">&gt; </span><br>

<span style="color: rgb(102, 102, 102);">&gt; "values":[null,null,null,null,null,null,null,null]}|</span><br>

<span style="color: rgb(102, 102, 102);">&gt; </span><br>

<span style="color: rgb(102, 102, 102);">&gt; No matter what I try, it keeps returning empty shapes. How can this be?</span><br>

<br>

Tom,<br>

<br>

I agree with Alexander that you should be carefully reviewing your<br>

input coordinate and insuring it is in the same coordinate system<br>

as the raster file.  The returned values are expected if you are<br>

attempting to fetch a non-existant result shape.<br>

<br>

If you simplify your test case down as much as you can and you still<br>

can't figure out why you do not get a result then you could try to<br>

bundle this up and submit it as a ticket.  Keep in mind that such a<br>

ticket is much more likely to be acted on if you make it *easy* for<br>

the developer to reproduce your problem.<br>

<br>

Best regards,<br>

-- <br>

---------------------------------------+--------------------------------------<br>

I set the clouds in motion - turn up   | Frank Warmerdam, <a href="javascript:top.opencompose('warmerdam@pobox.com','','','')">warmerdam@pobox.com</a><br>

light and sound - activate the windows | <a target="_blank" href="parse.php?redirect=http%3A%2F%2Fpobox.com%2F%7Ewarmerdam"><span style="color: red;">http://pobox.com/~warmerdam</span></a><br>

and watch the world go round - Rush    | Geospatial Programmer for Rent<br>

<br>

<br>

</blockquote></HTML>