Re: [postgis-users] Create raster from row-col table

2016-03-01 Thread Etienne B. Racine
Many thanks Pierre, I can create a 100 x 200 x 1000 raster in about 30 seconds. That's quite a lot of pixels organized ! For the archives, here's the complete code: -- CREATE SCHEMA test; CREATE TABLE test.measure AS SELECT r as rowy, c as colx, b as band, round(random() * 100)::float as v FROM

Re: [postgis-users] Create raster from row-col table

2016-02-29 Thread Pierre Racine
Hi Etienne, > Still, I can't figure how to load an arbitrary number of bands using your > snippet. If I remove WHERE band=1 I still get a unique band. This query will work for many bands and will aggregate all of them in a single raster: WITH rows AS ( SELECT band, colx, array_agg(v ORDER BY

Re: [postgis-users] Create raster from row-col table

2016-02-26 Thread Etienne B. Racine
(rast)).* > FROM newraster; > > You might have to play a bit with the col and row ordering to get exactly > what you want. > > Pierre > > > -Original Message- > > From: postgis-users [mailto:postgis-users-boun...@lists.osgeo.org] On > > Behalf Of Etienn

Re: [postgis-users] Create raster from row-col table

2016-02-26 Thread Pierre Racine
; From: postgis-users [mailto:postgis-users-boun...@lists.osgeo.org] On > Behalf Of Etienne B. Racine > Sent: Friday, February 26, 2016 8:34 AM > To: PostGIS Users Discussion > Subject: [postgis-users] Create raster from row-col table > > Hi list, > > > I have raster data

[postgis-users] Create raster from row-col table

2016-02-26 Thread Etienne B. Racine
Hi list, I have raster data stored in a table row-col format as measure(rowy integer, colx integer, band integer, value float). I've tried loading a multidimensional array (row x col x bands) with no success, however building a 2d array (row x col) works but it seems contrived, especially once I