[postgis-users] How compute the stats from a raster table.

Sandro Santilli strk at keybit.net
Fri Mar 16 08:33:36 PDT 2012


On Fri, Mar 16, 2012 at 09:52:38AM -0400, Pierre Racine wrote:
> > I guess it could be useful to define an aggregate taking "SummaryStats" type in
> > input so you could do something like:
> > 
> > SELECT (ST_SummaryStatsAgg(ST_SummaryStats(xx))).* FROM myrast;
> 
> Try this:
> 
> http://trac.osgeo.org/postgis/browser/trunk/raster/scripts/plpgsql/st_summarystatsagg.sql
> 
> ...exactly like strk wrote it.

BTW, reading the manual (incredibly, it helps!) I found out there's
a version of ST_SummaryStats that takes a table name.

Not flexible as the aggregate but for Andrea's case should do just fine.

--strk;

  ,------o-. 
  |   __/  |    Delivering high quality PostGIS 2.0 !
  |  / 2.0 |    http://strk.keybit.net - http://vizzuality.com
  `-o------'




More information about the postgis-users mailing list