[postgis-devel] [PostGIS] #985: [raster] ST_Count

PostGIS trac at osgeo.org
Tue Jun 7 10:11:16 PDT 2011


#985: [raster] ST_Count
-----------------------------+----------------------------------------------
  Reporter:  dustymugs       |       Owner:  dustymugs    
      Type:  task            |      Status:  reopened     
  Priority:  medium          |   Milestone:  PostGIS 2.0.0
 Component:  postgis raster  |     Version:  trunk        
Resolution:                  |    Keywords:  history      
-----------------------------+----------------------------------------------

Comment(by dustymugs):

 Yes, ST_Count can be optimized for the situation where
 ST_BandNodataValue() = NULL.

 {{{
   SELECT ST_Sum(rast), ST_Mean(rast) FROM mytable
 }}}

 In your example above, that would take twice the time as each function
 accesses the raster independently.  This could be resolved if we cached
 the raster's stats within the raster.

 The faster version of your example would be

 {{{
 SELECT sum, mean FROM ST_SummaryStats('mytable', 'rast')
 }}}

 Or some variation there-in.

 Maybe Regina could chime in about keeping ST_MinMax versus breaking it
 apart to ST_Min and ST_Max.  Personally, I'm indifferent except for the
 growing set of functions.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/985#comment:18>
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-devel mailing list