<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi all,<div class=""><br class=""></div><div class="">here’s the problem.</div><div class="">after creating the dummy raster : <a href="http://postgis.net/docs/manual-2.1/RT_reference.html" class="">http://postgis.net/docs/manual-2.1/RT_reference.html</a></div><div class="">i ran:</div><div class=""><span style="color: rgb(69, 69, 69);" class=""><br class=""></span></div><div class=""><div style="margin: 0px; line-height: normal; color: rgb(69, 69, 69);" class="">select (st_dumpvalues(rast)).* from dummy_rast;</div></div><div style="margin: 0px; line-height: normal; color: rgb(69, 69, 69);" class=""><br class=""></div><div style="margin: 0px; line-height: normal; color: rgb(69, 69, 69);" class="">and get:</div><div style="margin: 0px; line-height: normal; color: rgb(69, 69, 69);" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class=""><div style="color: rgb(69, 69, 69); margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class="">NOTICE: Raster provided has no bands</div><div style="color: rgb(69, 69, 69); margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class="">NOTICE: Raster provided has no bands</div><div style="color: rgb(69, 69, 69); margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class=""> nband | valarray </div><div style="color: rgb(69, 69, 69); margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class="">-------+-----------------------------------------------------------------------------------------------------------------</div><div style="color: rgb(69, 69, 69); margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class=""> 1 | {{253,254,253,254,254},{253,254,254,253,249},{250,254,254,252,249},{251,253,254,254,253},{252,250,254,254,254}}</div><div style="color: rgb(69, 69, 69); margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class=""> 2 | {{78,98,122,173,209},{96,118,180,249,254},{99,112,169,245,254},{89,99,122,176,229},{79,88,97,112,135}}</div><div style="color: rgb(69, 69, 69); margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class=""> 3 | {{70,86,100,135,161},{80,108,162,227,250},{90,108,175,251,254},{77,86,109,164,203},{62,69,76,86,101}}</div><div style="color: rgb(69, 69, 69); margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class="">(3 rows)</div><div style="color: rgb(69, 69, 69); margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><div style="color: rgb(69, 69, 69); margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-family: Helvetica; font-size: 12px;" class="">which by itself is kinda weird and that is why i unionized first, i.e.</span></div><div style="color: rgb(69, 69, 69); margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-family: Helvetica; font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal;" class=""><div style="color: rgb(69, 69, 69); font-family: Helvetica; font-size: 12px; margin: 0px; line-height: normal;" class="">select (st_dumpvalues(st_union(rast))).* from dummy_rast;</div><div style="color: rgb(69, 69, 69); font-family: Helvetica; font-size: 12px; margin: 0px; line-height: normal;" class=""><br class=""></div><div style="color: rgb(69, 69, 69); font-family: Helvetica; font-size: 12px; margin: 0px; line-height: normal;" class="">and now get a more proper output:</div><div style="color: rgb(69, 69, 69); font-family: Helvetica; font-size: 12px; margin: 0px; line-height: normal;" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class=""><div style="color: rgb(69, 69, 69); font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal;" class=""> nband | valarray </div><div style="color: rgb(69, 69, 69); font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal;" class="">-------+-----------------------------------------------------------------------------------------------------------------</div><div style="color: rgb(69, 69, 69); font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal;" class=""> 1 | {{253,254,253,254,254},{253,254,254,253,249},{250,254,254,252,249},{251,253,254,254,253},{252,250,254,254,254}}</div><div style="color: rgb(69, 69, 69); font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal;" class=""> 2 | {{78,98,122,173,209},{96,118,180,249,254},{99,112,169,245,254},{89,99,122,176,229},{79,88,97,112,135}}</div><div style="color: rgb(69, 69, 69); font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal;" class=""> 3 | {{70,86,100,135,161},{80,108,162,227,250},{90,108,175,251,254},{77,86,109,164,203},{62,69,76,86,101}}</div><div style="color: rgb(69, 69, 69); font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal;" class="">(3 rows)</div><div style="color: rgb(69, 69, 69); font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal;" class=""><br class=""></div><div style="color: rgb(69, 69, 69); margin: 0px; line-height: normal;" class="">however, my real concern is that when i compute the average over the 3 bands:</div><div style="color: rgb(69, 69, 69); margin: 0px; line-height: normal;" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class=""><font color="#454545" class="">select (st_dumpvalues(st_mapalgebra(array[row(rast, 1), row(rast, 2), row(rast, 3)]::rastbandarg[], 'st_mean4ma(double precision[], int[], text[])'::regprocedure))).* from (select st_union(rast) as rast from dummy_rast) as foo;</font></div><div style="margin: 0px; line-height: normal;" class=""><font color="#454545" class=""><br class=""></font></div><div style="margin: 0px; line-height: normal;" class=""><font color="#454545" class="">i get</font></div><div style="margin: 0px; line-height: normal;" class=""><font color="#454545" class=""><br class=""></font></div><div style="margin: 0px; line-height: normal;" class=""><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class=""> nband | valarray </div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class="">-------+-----------------------------------------------------------------------------------------------------------------</div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class=""> 1 | {{133,146,158,187,208},{143,160,198,243,251},{146,158,199,249,252},{139,146,161,198,228},{131,135,142,150,163}}</div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class="">(1 row)</div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="color: rgb(69, 69, 69); font-family: Helvetica; font-size: 12px;" class="">i.e. the actual means but rounded down, similarly for the standard deviation callback function.</span></div><div style="margin: 0px; line-height: normal;" class=""><font color="#454545" class="">is this a bug because it shouldn’t be rounded down, we should have the decimals too.</font></div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="color: rgb(69, 69, 69); font-family: Helvetica; font-size: 12px;" class="">thanx for feedback</span></div></div></div></div></div></body></html>