[postgis-users] PostGIS Raster ST_Value ST_SetValue performance

Hugues François hugues.francois at irstea.fr
Fri Jun 28 04:08:33 PDT 2013


I'm not sure to understand the problem, but I'll give a try.

You can try to reproduce Oracle's steps and make a plpg function that
1. first create a new table, or a multidimentionnal array, where you can store columnx, rowy (this can be done since you know the origin and cell size, calculating distance between origine and min x or y from geometries devided by cell size), your value and cell geom.
2. Then, you may make an empty raster from the extent of your entire geometries' table and fill it with values using columnx et rowy information.

Things should go faster if you try to work with a tiled and indexed raster (in this case you will have to store an rid in your geometries' table)

Hope this helps a bit


-----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, June 28, 2013 11:03 AM
To: postgis-users at lists.osgeo.org
Subject: [postgis-users] PostGIS Raster ST_Value ST_SetValue performance

Good morning,

It's my first comment to the email-list.

I'm developing a PLSQL-procedure that generate a raster band counting points of a geometry table/layer that are included in a cell. This can be seen as a simple clustering algorithm.

To do it, i'm using a cursor and determining the row and column of the pixel do an increment operation over pixel value. This is a ST_Value + ST_SetValue operation foreach point.
This is very slow.

In Oracle, this is slow too, but i can take an alternative way. Using a Array with binary index simulate the image, and latter when all the point has been "mapped" over the matrix transform this to a cellblob and later insert it on table that store image.

Have any one in the list any similar experience?
Can any give me a new orientation?

Best regards,
Miguel A. Manso

postgis-users mailing list
postgis-users at lists.osgeo.org

More information about the postgis-users mailing list