Remove the ST_MakeEmptyRaster() from your INSERT statement. -bborie
On Tue, Jan 7, 2014 at 12:31 PM, Gerardo Zárate <[email protected]>wrote: > 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. > > What I'm trying to accomplish is a table with multiple raster files like > the following example: > > CREATE TABLE public.dummy_raster > ( > rid integer NOT NULL, > rast1 raster, > rast2 raster, > CONSTRAINT dummy_raster_pkey PRIMARY KEY (rid) > ); > > I tried to copy the raster column of the table created by raster2pgsql to > my dummy table using the following code. > > INSERT INTO dummy_raster (rid, rast1) > SELECT 1, ST_MakeEmptyRaster(rast) > FROM rastertest WHERE rid = 1; > > UPDATE dummy_raster SET rast1 = (SELECT ST_AsRaster(NULL,p.rast) FROM > rastertest p WHERE p.rid=1) WHERE rid=1; > COMMIT; > > Both statements were executed successfully but when I try to import the > raster data into QGIS nothing is displayed. > > Is this the correct way to copy raster data from one column to other or is > there a better way to do this? > > Best regards, > > Gerardo Zárate > > > > > > _______________________________________________ > postgis-users mailing list > [email protected] > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users >
_______________________________________________ postgis-users mailing list [email protected] http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
