<div dir="ltr">I'm experimenting with rater in PostGIS 2.1.1. I manage to load a raster file into a table using raster2pgsql in Windows 7. I loaded the raster file into a single row of the table and displayed in QGIS 1.8 and QGIS 2.0.<div>
<br></div><div>What I'm trying to accomplish is a table with multiple raster files like the following example:</div><div><br><div><div>CREATE TABLE public.dummy_raster</div><div>(</div><div>  rid integer NOT NULL,</div>
<div>  rast1 raster,</div><div>  rast2 raster,</div><div>  CONSTRAINT dummy_raster_pkey PRIMARY KEY (rid)</div><div>);</div></div><div><br></div><div>I tried to copy the raster column of the table created by raster2pgsql to my dummy table using the following code.</div>
<div><br></div><div><div>INSERT INTO dummy_raster (rid, rast1)</div><div>SELECT 1, ST_MakeEmptyRaster(rast)</div><div>  FROM rastertest WHERE rid = 1;</div><div><br></div><div>UPDATE dummy_raster SET rast1 = (SELECT ST_AsRaster(NULL,p.rast) FROM rastertest p WHERE p.rid=1) WHERE rid=1;</div>
<div>COMMIT;</div></div><div><br></div><div>Both statements were executed successfully but when I try to import the raster data into QGIS nothing is displayed.</div><div><br></div><div>Is this the correct way to copy raster data from one column to other or is there a better way to do this?</div>
<div><br></div><div>Best regards,</div><div><br></div><div>Gerardo Zárate</div><div><br></div><div><br><div><br></div><div><br></div></div></div></div>