[GRASSLIST:131] Re: jumping moving window analysis

Martin Wegmann wegmann at biozentrum.uni-wuerzburg.de
Wed Mar 15 08:21:21 EST 2006


On Wednesday 15 March 2006 04:33, you wrote:
[....]
>
> g.region rast=gtopo30
>
> to get the box size, number of rows and columns, then
>
> g.region rast=srtm
>
> to match the res then set the region to the size/placement of the first
> gtopo30 cell.
>
> then iterate r.univar & adjusting the region.
>
> either by
>
> g.region e=e+${dx} w=w+${dx}
>  or
> g.region e=w w=w+${dx}    # ???
>
> then at the end of the row,
>
> g.region n=n-${dy} s=s-${dy}
>  or
> g.region n=s s=s-${dy}    # ???
>
> & reset e,w. Careful that the big & little cells line up. See the
> g.region help page for more on relative region changes.
>
>
> or v.mkgrid, as you thought, and a loop which does v.extract or v.select
> --o by the box ij ID, then g.region vect=single_box, r.univar, & loop.
>
>
> let me know if that doesn't make sense and I'll try and put together
> some pseudo-code which might explain it better. I've done this before
> with luck..

this looks good, I will give it a try and tell you how it worked out. Any code 
to decrease the working load is appreciated ,-)

regards, Martin




More information about the grass-user mailing list