[postgis-devel] Calculating flow direction
georger.silva at gmail.com
Fri Jul 30 17:26:19 PDT 2010
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.
I will burn some brain cells trying to get the whole table :P
Thanks for the feedback. This is very important to me!
If any of you tries out the function, please let me know your comments and
critics. They are most welcome.
On Fri, Jul 30, 2010 at 5:24 PM, Pierre Racine
<Pierre.Racine at sbf.ulaval.ca>wrote:
> >But, did you tested the function? I'm getting a few weird values for some
> tests i've been running.
> I did not try the function yet. however I fixed the ST_SetValue ticket. It
> might be related with the problem you are seeing.
> >Any suggestions on how I can achieve the use case that Pierre talked
> I see two cases:
> 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
> 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.
> In both cases your function have to be aware of the name of the table to
> find adjacent pixels or tiles.
> I would try the first one first... Should not be that complicated.
> >Is it possible to union all rasters inside a single table?
> Not yet but planned as ST_Union(rast)
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
George R. C. Silva
Desenvolvimento em GIS
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the postgis-devel