[postgis-tickets] [PostGIS] #1048: [raster] Coverage version of stats functions should be aggregates

PostGIS trac at osgeo.org
Mon Dec 9 11:28:57 PST 2013


#1048: [raster] Coverage version of stats functions should be aggregates
-------------------------+--------------------------------------------------
 Reporter:  pracine      |       Owner:  pracine       
     Type:  enhancement  |      Status:  new           
 Priority:  medium       |   Milestone:  PostGIS Future
Component:  raster       |     Version:  trunk         
 Keywords:               |  
-------------------------+--------------------------------------------------

Comment(by pracine):

 Replying to [comment:8 dustymugs]:
 > It looks like aggregate functions cannot return sets of values/records.
 >
 > [http://www.postgresql.org/message-id/CAFj8pRBX0z-
 qU6oor_R06vTq3a10vJ+k1zVkk0d69vctVpTe1A at mail.gmail.com]
 >
 > As such, aggregate versions of ST_Histogram, ST_Quantile and
 ST_ValueCount() cannot result in a format as presently returned for the
 standard forms. It looks like there needs to be a singular form of output,
 such as an array...
 >
 > {{{
 > SELECT
 >   ST_ValueCountAgg(rast, 1, ARRAY[1,2,3]::double precision[]) AS pvc
 > FROM foo
 >
 > pvc
 > ----------------------------------------------
 > {{1,12,0.33333},{2,12,0.33333},{3,12,0.33333}}
 > }}}

 So I guess you would like to make a small set returning function taking
 this output and splitting it into multiple rows/columns...

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/1048#comment:12>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list