[postgis-devel] raster: ST_Histogram - Not sure this is a bug or I just don't understand the numbers

Paragon Corporation lr at pcorp.us
Sun Dec 4 17:29:28 PST 2011


I was testing out the ST_Histogram and I was expecting my percentage to dd
up to 1 in both cases.
 
for example:
This query:
SELECT (st_histogram(rast,2,6, ARRAY[5,10,20,50,100,2000])).*  
FROM  postgis_analysis_20  
WHERE descrip = 'dbox3 2011-11-25';

-- gives me this which doesn't seem to jive with the counts (for example I
would expect the 15-25 bucket to be 0.95
 
 min | max  | count |        percent
-----+------+-------+-----------------------
  10 |   15 |    31 |  0.000563175583613407
  15 |   25 | 10557 |    0.0958942683259152
  25 |   45 |   220 |  0.000999182487056045
  45 |   95 |   135 |  0.000245253883186484
  95 |  195 |    48 | 4.36006903442638e-005
 195 | 2195 |    18 | 8.17512943954946e-007


-- this query looks like what I would expect - counts and percents agree

SELECT (st_histogram(rast,2,6)).*  
FROM   postgis_analysis_20  
WHERE descrip = 'dbox3 2011-11-25';


       min        |       max        | count |       percent
------------------+------------------+-------+----------------------
               10 | 307.333333333333 | 11003 |    0.999454991370697
 307.333333333333 | 604.666666666667 |     4 | 0.000363339086202198
 604.666666666667 |              902 |     0 |                    0
              902 | 1199.33333333333 |     0 |                    0
 1199.33333333333 | 1496.66666666667 |     0 |                    0
 1496.66666666667 |             1794 |     2 | 0.000181669543101099





More information about the postgis-devel mailing list