Hello Pierre,<br><br>The window is 3x3, testing eigth cells. This conveys the d8 direction model. theres the dn direction model, but it's a little trickier to implement.<br><br>I will burn some brain cells trying to get the whole table :P<br>

<br>Thanks for the feedback. This is very important to me!<br><br>If any of you tries out the function, please let me know your comments and critics. They are most welcome.<br><br>Thanks,<br><br>George<br><br><div class="gmail_quote">

On Fri, Jul 30, 2010 at 5:24 PM, Pierre Racine <span dir="ltr"><<a href="mailto:Pierre.Racine@sbf.ulaval.ca">Pierre.Racine@sbf.ulaval.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<div class="im">>But, did you tested the function? I'm getting a few weird values for some tests i've been running.<br>
<br>
</div>I did not try the function yet. however I fixed the ST_SetValue ticket. It might be related with the problem you are seeing.<br>
<div class="im"><br>
>Any suggestions on how I can achieve the use case that Pierre talked about?<br>
<br>
</div>I see two cases:<br>
<br>
1) You assume tiles are well aligned on the same grid and you work with raster coordinates: You find the 8 neighbour tiles one after the other by ST_Intersects them with 8 points relative to the center of the computed tile. You then arrange your math to take the neighbour tile pixels into account.<br>


<br>
2) You don't assume tiles are well aligned and you work with world coordinates: You find every pixel value needed for your calculation using "SELECT ST_Value(rast, point) FROM foo WHERE ST_Intersect(rast, point) 8 time (accually you window is 7 pixel by 7 pixel right?) for each pixel. For sure this one should be slower but would be more general as there is no garantee in a coverage that everything is perfect, tiles are the same size and well aligned.<br>


<br>
In both cases your function have to be aware of the name of the table to find adjacent pixels or tiles.<br>
<br>
I would try the first one first... Should not be that complicated.<br>
<div class="im"><br>
>Is it possible to union all rasters inside a single table?<br>
<br>
</div>Not yet but planned as ST_Union(rast)<br>
<font color="#888888"><br>
Pierre<br>
</font><div><div></div><div class="h5">_______________________________________________<br>
postgis-devel mailing list<br>
<a href="mailto:postgis-devel@postgis.refractions.net">postgis-devel@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-devel" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-devel</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>George R. C. Silva<br><br>Desenvolvimento em GIS<br><a href="http://blog.geoprocessamento.net">http://blog.geoprocessamento.net</a><br>