<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace">Hey,<br></div><div class="gmail_default" style="font-family:monospace,monospace">I suppose your raster is correctly cut into small pieces.<br><br></div><div class="gmail_default" style="font-family:monospace,monospace">You should first try to clock one point value retrieval.<br></div><div class="gmail_default" style="font-family:monospace,monospace">It should be < 50ms (or you have an index issue)<br></div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">Then you could force the use of index by writting a function <br>update_one_point(point) $$ update XXX set XXX WHERE ST_Intersects(rast,point);$$<br></div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">You would then call your function on all points:<br><br></div><div class="gmail_default" style="font-family:monospace,monospace">SELECT update_one_point(hp.geom4326)<br></div><div class="gmail_default" style="font-family:monospace,monospace">FROM hp<br><br></div><div class="gmail_default" style="font-family:monospace,monospace">Cheers<br></div><div class="gmail_default" style="font-family:monospace,monospace">Rémi-C<br></div><div class="gmail_default" style="font-family:monospace,monospace"> </div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-02-04 6:44 GMT+01:00 J Payne <span dir="ltr"><<a href="mailto:jcpayne@uw.edu" target="_blank">jcpayne@uw.edu</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="white" link="#0563C1" vlink="#954F72" lang="EN-US"><div class="m_-206938367992120490WordSection1"><p class="MsoNormal"><span style="font-size:11.0pt">Hello.  I have an animal track that wanders around on a landscape, and I want to extract the pixel values for each location on the track.  This kind of operation is very common for animal studies.  The landscape is represented by a one-row raster map (“landforms4326”), and the GPS positions are in a table called “hourly_positions”.  I am using a recent version of PostGIS and a very simple query to find the pixel values:<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt">UPDATE hourly_positions hp SET landform = (SELECT ST_Value(rast,hp.geom4326) FROM landforms4326)<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt">I have about 450,000 points, and both the landscape raster and the point geometries are indexed.  For some reason, the operation is *<b>incredibly</b>* slow (it’s already been running for more than 8 hours on a nearly new Macbook Pro, and still isn’t finished).  Am I missing something?  I can’t for the life of me imagine why it would be so slow, since PostGIS is very fast with all sorts of other operations on the same data (intersections, etc.).<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt">Thanks,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt">John<u></u><u></u></span></p></div></div>
<br>______________________________<wbr>_________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/postgis-users</a><br></blockquote></div><br></div>