[postgis-users] How to transform point data to 2-dims array for use in ST_SetValues

Bborie Park dustymugs at gmail.com
Wed Apr 3 08:14:33 PDT 2013


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 <gismage at gmail.com> 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
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20130403/6e8f14c9/attachment.html>


More information about the postgis-users mailing list