<HTML>
Hi Jukka,<br>
<br>
Hmmm that does look strange, but as it turns out, removing "LAYER" didn't help.<br>
<br>
Thx anyway ;)<br>
<br>
Tom<br>
<br>
 <br>
<br>
<span style="font-weight: bold;">On Wed 02/06/10 13:23 , "Rahkonen Jukka" Jukka.Rahkonen@mmmtike.fi 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;">

<defanged_meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>BODY {
        FONT-SIZE: 12px; FONT-FAMILY: Arial, Helvetica, sans-serif
}
</style>

<defanged_meta content="MSHTML 6.00.2900.5945" name="GENERATOR"><defanged_body>
<div dir="ltr" align="left"><span style="font-size: 10pt; color: rgb(0, 0, 255);" class="117442011-02062010">Hi,</span></div>
<div dir="ltr" align="left"><span style="font-size: 10pt; color: rgb(0, 0, 255);" class="117442011-02062010"></span>&nbsp;</div>
<div dir="ltr" align="left"><span style="font-size: 10pt; color: rgb(0, 0, 0);" class="117442011-02062010">LAYER TEMPLATE 
"dummy.html"?</span></div>
<div dir="ltr" align="left"><span style="font-size: 10pt; color: rgb(0, 0, 0);" class="117442011-02062010"></span>&nbsp;</div>
<div dir="ltr" align="left"><span style="font-size: 10pt; color: rgb(0, 0, 0);" class="117442011-02062010">Does such a thing exist? Have you tried with 
plain</span></div>
<div dir="ltr" align="left"><span style="font-size: 10pt; color: rgb(0, 0, 0);" class="117442011-02062010">&nbsp;TEMPLATE "dummy.html"?</span></div>
<div dir="ltr" align="left"><span style="font-size: 10pt; color: rgb(0, 0, 0);" class="117442011-02062010"></span>&nbsp;</div>
<div dir="ltr" align="left"><span style="font-size: 10pt; color: rgb(0, 0, 0);" class="117442011-02062010">-Jukka Rahkonen-</span></div>
<div><span style="font-size: 10pt; color: rgb(0, 0, 255);" class="117442011-02062010"><span style="color: rgb(0, 0, 0);"></span>&nbsp;</span></div>
<div dir="ltr" align="left"><span style="font-size: 10pt; color: rgb(0, 0, 255);"><br>
</span></div><span style="font-size: 10pt; color: rgb(0, 0, 255);"></span><br>

<blockquote dir="ltr" style="padding-left: 5px; margin-left: 5px; border-left: 2px solid rgb(0, 0, 255); margin-right: 0px;">
  <div class="OutlookMessageHeader" dir="ltr" align="left" lang="fi">
  <hr tabindex="-1">
  <span style="font-family: Tahoma; font-size: 10pt;"><span style="font-weight: bold;">Lähettäjä:</span> 
  mapserver-users-bounces@lists.osgeo.org 
  [mailto:mapserver-users-bounces@lists.osgeo.org] <span style="font-weight: bold;">Puolesta </span>Tom van der 
  Putte<br>
<span style="font-weight: bold;">Lähetetty:</span> 2. kesäkuuta 2010 13:34<br>
<span style="font-weight: bold;">Vastaanottaja:</span> 
  Frank Warmerdam; Alexander Petkov<br>
<span style="font-weight: bold;">Kopio:</span> 
  mapserver-users@lists.osgeo.org<br>
<span style="font-weight: bold;">Aihe:</span> Re: Re: [mapserver-users] 
  Mapscript Rasterquery returns empty result<br>
</span><br>
</div>
  <div></div>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>
<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>
<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>
<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>
<br>
<br>
The TIFF I use for testing is available from:  </span><style>BODY {
        FONT-SIZE: 12px; FONT-FAMILY: Arial, Helvetica, sans-serif
}
</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="padding-right: 0px; padding-left: 5px; margin-left: 5px; border-left: 2px solid rgb(245, 245, 245); margin-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>

    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 ?redirect="http%3A%2F%2Fpobox.com%2F%7Ewarmerdam&quot;" target="_blank"><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></blockquote></defanged_body></defanged_meta></defanged_meta></blockquote></HTML>