[postgis-users] WKT Raster

Volkmar Herbst privat volkmar.herbst at gmx.de
Tue Sep 27 12:54:09 PDT 2011


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 






More information about the postgis-users mailing list