Cool, so we got the query working and what we wanted is achieved with our little service. However, what we are doing is probably far from optimal:<div><br></div><div>We query the points on the line with one query for each point. This could be optimised like this:</div>
<div><div>SELECT<span class="" style="white-space:pre">   </span>ST_AsText(</div><div><span class="" style="white-space:pre">         </span>ST_line_interpolate_point(</div><div><span class="" style="white-space:pre">                 </span>ST_GeometryFromText('LINESTRING(0 0,0 1,1 1)'), CAST(p AS numeric)/10<span class="" style="white-space:pre">                                             </span></div>
<div><span class="" style="white-space:pre">            </span>)</div><div><span class="" style="white-space:pre">  </span>)</div><div>FROM generate_series(1,10) p;</div></div><div>to get all points. But this is still requiring one query for each point on the line. I suspect, if we were to query all points at once, there will have to be less reading of the raster, because the points are likely to be on the same tile. However, I do not know how to achieve that. Can I somehow intersect the line with the raster and query all the points above?</div>
<div><br></div><div>Any hints would be greatly appreciated.</div><div><br></div><div>Thanks,</div><div>Tim</div><div class="gmail_extra"><br clear="all"><div>Tim-Hinnerk Heuer<br><br>Twitter: @geekdenz<br><div>Blog: <a href="http://www.thheuer.com/" target="_blank">http://www.thheuer.com</a></div>
</div><br>
<br><br><div class="gmail_quote">On 9 December 2012 20:36, Tim-Hinnerk Heuer <span dir="ltr"><<a href="mailto:th.heuer@gmail.com" target="_blank">th.heuer@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="gmail_extra">Hi Pierre,</div><div class="gmail_extra"><br></div><div class="gmail_extra">Great! Thank you so much, that worked!</div><div class="gmail_extra"><br></div><div class="gmail_extra">You're a genius!</div>

<div class="gmail_extra"><br></div><div class="gmail_extra">In case you are wondering. That point is Mount Ruhapehu and it gave me the answer: 2611.7314453125 (m) which is indeed correct.</div><div class="gmail_extra"><br>

</div><div class="gmail_extra">Kind regards,</div><div class="gmail_extra">Tim<div class="im"><br clear="all"><div>Tim-Hinnerk Heuer<br><br>Twitter: @geekdenz<br><div>Blog: <a href="http://www.thheuer.com/" target="_blank">http://www.thheuer.com</a></div>

</div><br>
<br><br></div><div class="im"><div class="gmail_quote">On 9 December 2012 20:24, Pierre Racine <span dir="ltr"><<a href="mailto:Pierre.Racine@sbf.ulaval.ca" target="_blank">Pierre.Racine@sbf.ulaval.ca</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div>SELECT ST_Value(rast,ST_SetSRID(ST_Point(1821416, 5649720), 2193))<br>
FROM nzdem3<br>
WHERE  ST_Intersects(rast,ST_SetSRID(ST_Point(1821416, 5649720), 2193))</div></blockquote></div><br></div></div>
</blockquote></div><br></div>