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

Etienne B. Racine etiennebr at gmail.com
Fri Feb 26 05:33:55 PST 2016


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 need to stack the bands. I'm still figuring
the best way to store the rasters, but I might end up storing 39 bands in a
single raster. For now building an array isn't very fast, so I'm looking
for speed improvement as well.

I wonder what's the most efficient way to populate a raster with data of
this shape ? My actual method wouldn't work with sparse data and would
require to pad the array with nodata values.

I've put out a gist that explains my solution with sample data :
https://gist.github.com/etiennebr/370a773029160c30d165#file-rowcol-raster-sql

Thanks for your help,
Etienne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20160226/015d92d6/attachment.html>


More information about the postgis-users mailing list