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

Pierre Racine Pierre.Racine at sbf.ulaval.ca
Fri Sep 27 06:57:29 PDT 2013


What is this misterious calculation that can't be performed with any version of MapAlgebra?

> -----Original Message-----
> From: postgis-users-bounces at lists.osgeo.org [mailto:postgis-users-
> bounces at lists.osgeo.org] On Behalf Of Miguel-Angel Manso-Callejo (UPM)
> Sent: Friday, September 27, 2013 2:25 AM
> To: postgis-users at lists.osgeo.org
> Subject: [postgis-users] About 2-dimensional arrays of postgresql
> 
> 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



More information about the postgis-users mailing list