<br><font size=2 face="sans-serif">I started drooling over ST_Histogram()
in postgis trunk. Thus far, I think my use case prevents me from using
it, but I'd like to confirm with the list.</font>
<br>
<br><font size=2 face="sans-serif">I have a raster (derived image from
a Landsat scene) which is coarsely tiled: 833x833. This gives me 110 tiles
for the scene. Separately, I have a polygon coverage of a fire perimeter.</font>
<br>
<br><font size=2 face="sans-serif">Basically, what I want to do is this:
</font>
<br>
<br><font size=2 face="sans-serif">1] Globally (i.e., not for an individual
tile, but for the entire scene) I want one histogram of raster values for
pixels which are inside the fire perimeter, and one histogram of raster
values for pixels which are outside.</font>
<br><font size=2 face="sans-serif">2] For each individual tile, I want
separately computed histograms for pixels inside and outside the fire perimeter.</font>
<br>
<br><font size=2 face="sans-serif">My understanding is that I cannot do
#2 because ST_Intersection() always returns a setof geomval, and never
returns a "subset raster". I believe I cannot do #1 because in
addition to this ST_Intersection behavior, there is no way to re-assemble
the tiles into one giant raster prior to feeding it to ST_Histogram. It
appears I can run ST_Histogram only on individual, whole tiles.</font>
<br>
<br><font size=2 face="sans-serif">I am currently pursuing a vector solution
using ST_DumpAsPolygons() but this is very slow. Hence I have time to send
questions to the list. :) </font>
<br>
<br><font size=2 face="sans-serif">I have outlined my vector plan of attack
here: </font><a href=https://collab.firelab.org/software/projects/modisfire/wiki/Calculating_histograms_with_PostGIS_Raster><font size=2 face="sans-serif">https://collab.firelab.org/software/projects/modisfire/wiki/Calculating_histograms_with_PostGIS_Raster
 If you believe this to be a worthy tutorial-in-progress, you may
copy or link to it as you see fit. I expect it will change as I pursue
this activity further.</font></a>
<br>
<br><font size=2 face="sans-serif">Bryce</font>