[postgis-devel] raster2pgsql error?

dustymugs dustymugs at gmail.com
Wed Mar 7 10:20:27 PST 2012


On 03/07/2012 10:12 AM, Salvatore Larosa-1 wrote:
> Hi,
> I'm trying to import a tif raster [1] into PostGIS but I have a problem!
>
> raster2pgsql command seems to run correctly,
> but when I try to display the raster in qgis my map is empty!
>
> below what i do:
>
> 1] postgres at debian:~$ raster2pgsql -s 4236 -I -C -M
> /home/sam/pgraster_test/katrina.tif -F -t 64x64 public.katrina>
> /home/sam/pgraster_test/katrina.sql
>
> 2] postgres at debian:~$ psql -f /home/sam/pgraster_test/katrina.sql -d
> workshop
>
> in QGIS:
>
>>>> from qgis.utils import iface
>>>> connection = "PG:host='localhost' port='5432' dbname='workshop'
>>>> user='postgres' password='*******' schema='public' table='katrina'
>>>> mode='2'"
>>>> iface.addRasterLayer(connection, "katrina")
>
> Any hint?
>
>

First, check to see if there is data in any of the three bands of that 
raster.  Something like

SELECT ST_SummaryStats(rast) FROM public.katrina

If there are counts, there is data.

My guess is that QGIS isn't rendering correctly.  I can't say much about 
the PostGIS Raster plugin as it has been a while since I tried using it 
and at last check, it was out-of-date with regards to PostGIS trunk (to 
become 2.0).

-bborie



More information about the postgis-devel mailing list