[postgis-users] PostGIS Raster Decimal?

Pierre Racine Pierre.Racine at sbf.ulaval.ca
Mon Mar 14 08:08:10 PDT 2011


This is a well known problem. See ticket http://trac.osgeo.org/postgis/ticket/650

I will discuss this problem with Frank this week at the code sprint in Montreal.

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).


>-----Original Message-----
>From: Pierre Racine
>Sent: 14 mars 2011 10:55
>To: Pierre Racine
>Subject: FW: [postgis-users] PostGIS Raster Decimal?
>From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-
>bounces at postgis.refractions.net] On Behalf Of Andreas Forø Tollefsen
>Sent: 14 mars 2011 10:53
>To: PostGIS Users Discussion
>Subject: [postgis-users] PostGIS Raster Decimal?
>Hi. Again.
>I have been working on some raster data in PostGIS lately.
>However, i have some issues with the raster values become integer after importing the sql to postgis.
>For instance this procedure:
>C:\prio_grid\source\gpw>c:\python26\python c:\prio_grid\script\raster2pgsql.py -
>r c:\prio_grid\source\gpw\lrc30p90\glp90ag30\w001001.adf -t gpw90 -s 4326 -o gpw
>90.sql -I -M
>Then to database:
>C:\prio_grid\source\gpw>psql -h -d priogrid -f gpw90.sql
>Querying this data:
>SELECT gpw90.gid, ((gpw90.gpw90val).val) AS gpw90
>INTO popgrid
>FROM (SELECT priogrid_land.gid, ST_Intersection(gpw90.rast, priogrid_land.centroid) AS gpw90val FROM
>gpw90, priogrid_land WHERE ST_Intersects(priogrid_land.centroid, gpw90.rast)) AS gpw90
>WHERE gpw90.gid = 139303
>GROUP BY gid,((gpw90.gpw90val))
>gid; gpw90
>The value in the original raster is:
>Question is then. How can i ensure that raster remain decimal and not integer after this import and
>query process?

More information about the postgis-users mailing list