[postgis-users] Basic postgis raster questions
Bryce L Nordgren
bnordgren at fs.fed.us
Thu Jun 2 15:33:51 PDT 2011
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.
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.
Basically, what I want to do is this:
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.
2] For each individual tile, I want separately computed histograms for
pixels inside and outside the fire perimeter.
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.
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. :)
I have outlined my vector plan of attack here:
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.
Bryce
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20110602/36bde273/attachment.html>
More information about the postgis-users
mailing list