<div dir="ltr">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.<div>
<br></div><div style>SELECT<br></div><div style>array_agg(ROW(geom, vale)::geomval) AS agg1,</div><div>array_agg(ROW(geom, valv)::geomval) AS agg2</div><div style>FROM mytable</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Tue, Apr 2, 2013 at 1:25 PM, Gis Mage <span dir="ltr"><<a href="mailto:gismage@gmail.com" target="_blank">gismage@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hi, list!<div><br></div><div>I have a table of points that form a grid of equally distributed 1000x1000 points (1 mln records in a table). </div><div>The fields are lon,lat,vale,valv,geom</div><div>
My goal is to create a 1000x1000 px raster with two bands, representing vale and valv values from points of initial table.</div><div>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.</div>

<div>Can someone give an example SQL expression to create a 2 dimensional array from table of values?</div></div>
<br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>
<br></blockquote></div><br></div>