Can you isolate the geometry that is causing the NaN?  Maybe something like<br><br>SELECT<br>  rowid,<br>  ST_X(geometry)<br>  ST_Y(geometry)<br>FROM mygeometrytable<br><br>The error message indicates that somehow a NaN is being passed to ST_World2RasterCoordX...<br>
<br>Also, your query isn't ideal.  You should add another WHERE clause dealing with the intersection of the rast and the geometry.<br><br>UPDATE export.tous_point_espece_selon_format_esri SET<br>pente_mnt = ST_VALUE(rast, geometrie, true)<br>
<div>
FROM raster.pente_mnt30 <br>
WHERE code_insee LIKE '30%'<br>AND ST_Intersects(geometrie, rast)<br></div><br>-bborie<br><br><div class="gmail_quote">On Tue, Jul 31, 2012 at 2:09 AM, Mathieu Bossaert (CEN L-R) <span dir="ltr"><<a href="mailto:sig@cenlr.org" target="_blank">sig@cenlr.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-size:10pt;font-family:arial,helvetica,sans-serif"><div style="font-size:10pt;font-family:arial,helvetica,sans-serif">
Good morning,<br><br>first of all I want to thank the PostGIS community for the great job she does.<br><br>I am a french user of postgis since 2006 and it helps us a lot in our mission to preserve landscapes and biodiversity.<br>
Since a few month we use rasters function in order to characterize species distribution.<br><br>I have a problem with 1 of 5 raster table containing a dem.<br>When I try to populate an elevation attribute of a point layer from this raster I get an error. To workaround this problem I use pg-script to run this update line after line. <br>
<br>Is there a way to run this command, skipping the error.<br><br>Here is the query : <br><br>UPDATE export.tous_point_espece_selon_format_esri SET pente_mnt = ST_VALUE(rast, geometrie, true)<br>
FROM raster.pente_mnt30 <br>
WHERE code_insee LIKE '30%'<br><br>And here is the error (sorry it's in french)<br><br>ERREUR: syntaxe en entrée invalide pour l'entier : « NaN » <br>CONTEXTE : PL/pgSQL function "st_world2rastercoordx" lors de la conversion de la valeur de retour au type de retour de la fonction PL/pgSQL function "st_value" line 13 at RETURN <br>
<br>Thanks again,<br><br>Mathieu Bossaert<br><br><div><span></span>--<br><font style="color:rgb(102,102,102)" size="1"><i>Mathieu BOSSAERT</i><br style="font-style:italic"><i>Responsable du </i><a style="font-style:italic" href="http://si.cenlr.org/" target="_blank">système d'information</a></font><font style="font-weight:bold;font-style:italic;color:rgb(102,102,102)" size="1"> du CEN L-R</font><br>
<font style="font-style:italic;color:rgb(102,102,102)" size="1">04 67 29 90 65 - <a href="mailto:sig@cenlr.org" target="_blank">sig@cenlr.org</a></font><br><img src=""><br><span></span><br></div></div></div></div><br>_______________________________________________<br>

postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Bborie Park<br>Programmer<br>Center for Vectorborne Diseases<br>UC Davis<br>530-752-8380<br><a href="mailto:bkpark@ucdavis.edu">bkpark@ucdavis.edu</a><br>