[postgis-users] st_value/st_world2rastercoordx error
Bborie Park
bkpark at ucdavis.edu
Tue Jul 31 07:06:56 PDT 2012
Can you isolate the geometry that is causing the NaN? Maybe something like
SELECT
rowid,
ST_X(geometry)
ST_Y(geometry)
FROM mygeometrytable
The error message indicates that somehow a NaN is being passed to
ST_World2RasterCoordX...
Also, your query isn't ideal. You should add another WHERE clause dealing
with the intersection of the rast and the geometry.
UPDATE export.tous_point_espece_selon_format_esri SET
pente_mnt = ST_VALUE(rast, geometrie, true)
FROM raster.pente_mnt30
WHERE code_insee LIKE '30%'
AND ST_Intersects(geometrie, rast)
-bborie
On Tue, Jul 31, 2012 at 2:09 AM, Mathieu Bossaert (CEN L-R)
<sig at cenlr.org>wrote:
> Good morning,
>
> first of all I want to thank the PostGIS community for the great job she
> does.
>
> I am a french user of postgis since 2006 and it helps us a lot in our
> mission to preserve landscapes and biodiversity.
> Since a few month we use rasters function in order to characterize species
> distribution.
>
> I have a problem with 1 of 5 raster table containing a dem.
> 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.
>
> Is there a way to run this command, skipping the error.
>
> Here is the query :
>
> UPDATE export.tous_point_espece_selon_format_esri SET pente_mnt =
> ST_VALUE(rast, geometrie, true)
> FROM raster.pente_mnt30
> WHERE code_insee LIKE '30%'
>
> And here is the error (sorry it's in french)
>
> ERREUR: syntaxe en entrée invalide pour l'entier : « NaN »
> 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
>
> Thanks again,
>
> Mathieu Bossaert
>
> --
> *Mathieu BOSSAERT*
> *Responsable du *système d'information <http://si.cenlr.org/> du CEN L-R
> 04 67 29 90 65 - sig at cenlr.org
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
--
Bborie Park
Programmer
Center for Vectorborne Diseases
UC Davis
530-752-8380
bkpark at ucdavis.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20120731/15b65f40/attachment.html>
More information about the postgis-users
mailing list