Hi Pierre.<div><br></div><div>Yes. I think that would be an appropriate temporary fix.</div><div>Still, a bit problematic when working with climate data which very often include decimal digits and often have weekly and monthly rasters for 100's of years :)</div>
<div><br></div><div>Good luck.</div><div><br></div><div>Best,</div><div>Andreas<br><div><br><div class="gmail_quote">2011/3/14 Pierre Racine <span dir="ltr"><<a href="mailto:Pierre.Racine@sbf.ulaval.ca">Pierre.Racine@sbf.ulaval.ca</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Andreas,<br>
<br>
This is a well known problem. See ticket <a href="http://trac.osgeo.org/postgis/ticket/650" target="_blank">http://trac.osgeo.org/postgis/ticket/650</a><br>
<br>
I will discuss this problem with Frank this week at the code sprint in Montreal.<br>
<br>
For now you can use some GIS with map algebra capability to multiply your raster by 10 before importing or test our brand new ST_MapAlgebra function (still to debug).<br>
<br>
Pierre<br>
<br>
>-----Original Message-----<br>
>From: Pierre Racine<br>
>Sent: 14 mars 2011 10:55<br>
>To: Pierre Racine<br>
>Subject: FW: [postgis-users] PostGIS Raster Decimal?<br>
><br>
><br>
><br>
>From: <a href="mailto:postgis-users-bounces@postgis.refractions.net">postgis-users-bounces@postgis.refractions.net</a> [mailto:<a href="mailto:postgis-users-">postgis-users-</a><br>
><a href="mailto:bounces@postgis.refractions.net">bounces@postgis.refractions.net</a>] On Behalf Of Andreas Forĝ Tollefsen<br>
>Sent: 14 mars 2011 10:53<br>
>To: PostGIS Users Discussion<br>
>Subject: [postgis-users] PostGIS Raster Decimal?<br>
<div><div></div><div class="h5">><br>
>Hi. Again.<br>
><br>
>I have been working on some raster data in PostGIS lately.<br>
>However, i have some issues with the raster values become integer after importing the sql to postgis.<br>
>For instance this procedure:<br>
><br>
>C:\prio_grid\source\gpw>c:\python26\python c:\prio_grid\script\raster2pgsql.py -<br>
>r c:\prio_grid\source\gpw\lrc30p90\glp90ag30\w001001.adf -t gpw90 -s 4326 -o gpw<br>
>90.sql -I -M<br>
><br>
>Then to database:<br>
>C:\prio_grid\source\gpw>psql -h 192.168.1.55 -d priogrid -f gpw90.sql<br>
><br>
>Querying this data:<br>
>SELECT gpw90.gid, ((gpw90.gpw90val).val) AS gpw90<br>
>INTO popgrid<br>
>FROM (SELECT priogrid_land.gid, ST_Intersection(gpw90.rast, priogrid_land.centroid) AS gpw90val FROM<br>
>gpw90, priogrid_land WHERE ST_Intersects(priogrid_land.centroid, gpw90.rast)) AS gpw90<br>
>WHERE gpw90.gid = 139303<br>
>GROUP BY gid,((gpw90.gpw90val))<br>
>;<br>
><br>
>Gives:<br>
>gid; gpw90<br>
>139303;39849<br>
><br>
>The value in the original raster is:<br>
>39849.2<br>
><br>
>Question is then. How can i ensure that raster remain decimal and not integer after this import and<br>
>query process?<br>
><br>
>Thanks.<br>
>Andreas<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>
</div></div></blockquote></div><br></div></div>