We should probably at some point provide a ST_SetValues(raster, ARRAY[values]). Would this help?
Pierre > -----Original Message----- > From: [email protected] [mailto:postgis-users- > [email protected]] On Behalf Of Volkmar Herbst privat > Sent: Tuesday, September 27, 2011 3:54 PM > To: [email protected] > Subject: [postgis-users] WKT Raster > > Hi all, > I have a question concerning the creation of a raster in a plr function. I > create a > empty raster and set the pixel values individually with update > queries: > > for(i in 1:nrow(mat_p)) { > for(j in 1:ncol(mat_p)) { > pg.spi.exec(sprintf ("UPDATE nutrients.applications SET raster = > ST_SetValue(raster,%s, %s, %s,%s) WHERE id = %s ;", 3, j, i, mat_cao[i,j], > rid)) > } > } > > This takes quite a long time.. > Does anyone know an alternative approach to create a WKT- Raster in R directly > without setting each pixel value and export it to a Postgis table? > Or is it possible to write the binary raster somehow? > Any hints are most welcome, > > Volkmar > > > > _______________________________________________ > postgis-users mailing list > [email protected] > http://postgis.refractions.net/mailman/listinfo/postgis-users _______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users
