<div dir="ltr">Hi<div><br></div><div>I read through your first email a bit fast, and didn't notice the raster layer, but I'm glad you got some help out of my response anyways. Your proposal is susceptible to sql injections and MUST be changed.  Instead of doing string-formatting you should use psycopg when passing parameters, see <a href="http://initd.org/psycopg/docs/usage.html#passing-parameters-to-sql-queries">http://initd.org/psycopg/docs/usage.html#passing-parameters-to-sql-queries</a>. </div>
<div><br></div><div>Also, it seems like you your SQL query is missing a part. I'm guessing it should start something like</div><div>WITH points2d AS (</div><div>SELECT st_point(%s, %s) AS geom</div><div>)</div><div>If your raster layer uses a SRID you will have to specify it for your point as well, but other than that the query looks fine.</div>
<div><br></div><div>I'm not sure I understand what you want to do with your pixel-to-point table. Your example should already extract the elevation data for a given coordinate. Unless you need that table for some other functionality, it will only deteriorate your db's performance.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 23, 2014 at 11:49 AM, dandrigo <span dir="ltr"><<a href="mailto:lcelati@latitude-geosystems.com" target="_blank">lcelati@latitude-geosystems.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
Thank you for your proposal.<br>
<br>
Currently in my database, I have no point layer. In addition mnt, I have 2<br>
layers surface (regarding land cover).<br>
<br>
In addition to your proposal, what do you think of this new proposal ,<br>
below, which is the intersection between a point and the DTM?<br>
<br>
temp.py <<a href="http://postgis.17.x6.nabble.com/file/n5006394/temp.py" target="_blank">http://postgis.17.x6.nabble.com/file/n5006394/temp.py</a>><br>
<br>
<br>
Let's say I opted for this latter proposal. Would it be judicious to<br>
generate centroid 2Dpoints for each pixel from my dem raster ( a new table<br>
postgis table centroid 2D points in order to do the intersection with the<br>
dem).<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://postgis.17.x6.nabble.com/psycopg-web-service-tp5006366p5006394.html" target="_blank">http://postgis.17.x6.nabble.com/psycopg-web-service-tp5006366p5006394.html</a><br>
<div class="HOEnZb"><div class="h5">Sent from the PostGIS - User mailing list archive at Nabble.com.<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>
</div></div></blockquote></div><br></div>