[postgis-users] About 2-dimensional arrays of postgresql

Miguel-Angel Manso-Callejo (UPM) m.manso at upm.es
Thu Sep 26 23:25:23 PDT 2013


Dear all,

I'm writing a stored procedure (pgplSQL) that uses postgis functions 
version 2.1
Dump the contents of an image on a two-dimensional array and then I 
update the cells according to some calculations.
The process is slow, but after a while I discovered devote to the 
problem, or the slowness is due to operations that read and update the 
two-dimensional array.

The code is roughly this:

DECLARE
..
*img***double precision [] [];

i integer j integer;

BEGIN

select ST_DumpValues (rast, 1, false) INTO *img***from ..

for i IN 1 .. 1000 LOOP
for j IN 1 .. 500 LOOP
........
*img***[i] [j]: = ..............;
END LOOP;
END LOOP;

select ST_SetValues (image, 1, 1, 1, *img*) INTO imagen2;
....
END;

Anyone know why the update of the values of the two-dimensional array is 
slow?, Poorly defined array for the type of operations performed?

thank you very much
Best regards.

Miguel A. Manso
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20130927/d501d0b9/attachment.html>


More information about the postgis-users mailing list