You have the correct idea but don't need to do that sort step. Something like the following should work (I haven't tested this) to create the necessary geomval arrays for passing into ST_SetValues.
SELECT array_agg(ROW(geom, vale)::geomval) AS agg1, array_agg(ROW(geom, valv)::geomval) AS agg2 FROM mytable On Tue, Apr 2, 2013 at 1:25 PM, Gis Mage <[email protected]> wrote: > Hi, list! > > I have a table of points that form a grid of equally distributed 1000x1000 > points (1 mln records in a table). > The fields are lon,lat,vale,valv,geom > My goal is to create a 1000x1000 px raster with two bands, representing > vale and valv values from points of initial table. > I guess the best way to do it is to sort the initial table by lon, lat and > form a 2 dimensional array for each of the band, so I can then put it in > ST_SetValues as an argument. Then it'll fill the entire band with values at > once instead of using ST_SetValue to burn each value into raster pixel by > pixel. > Can someone give an example SQL expression to create a 2 dimensional array > from table of values? > > _______________________________________________ > 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
