[postgis-devel] ST_Value performance

Sandro Santilli strk at keybit.net
Tue Jan 31 14:14:01 PST 2012


On Tue, Jan 31, 2012 at 05:04:54PM -0500, Pierre Racine wrote:
> > It would take a set of (x,y,band,value) or (geometry,band,value) in input and
> > incrementally transform a raster to set the values.
> > 
> > Didn't really think about how you can initialize an aggregate function to provide
> > a target dimension for the output raster.
> 
> I don't know how ST_AsRaster react when you pass it a point. If it produce a 1 pixel raster (that's what I would expect) then you could try:
> 
> SELECT ST_Union(ST_AsRaster(geometry, alignment info,...))
> FROM your table

I have the 1-pixel tiles already, ST_Union is actually running like this:

CREATE TABLE chenyx06a_single AS
 SELECT ST_AddBand(null, ARRAY[
                           st_union(rast,1),
                           st_union(rast,2),
                           st_union(rast,3),
                           st_union(rast,4)
                              ])
 FROM chenyx06a;

The chenyx06a contains ~200k 1x1 4-bands rasters.

It's been running for over 10 minutes as I write...

--strk; 

  ,------o-. 
  |   __/  |    Thank you for PostGIS-2.0 Topology !
  |  / 2.0 |    http://www.pledgebank.com/postgistopology
  `-o------'




More information about the postgis-devel mailing list