[GRASSLIST:6500] Re: buffers and statistics

Trevor Wiens twiens at interbaun.com
Sat Apr 16 14:46:27 EDT 2005


On Fri, 15 Apr 2005 15:58:14 -0500
Martin du Saire <mdusaire at umn.edu> wrote:

> Thanks for all your help on the sites to vector question.  I think I'm on 
> my way to figuring it out.
> 
> Next question:
> 
> Is the process I am using to obtain the data I need a reasonable way to go 
> about it, or am I missing something (not having any real GIS training or 
> experience)?
> 
> a)  I used m.proj2 to convert my site location to the appropriate projection.
> b)  defined the site with s.in.ascii, and converted it to a raster using 
> s.to.rast.
> c)  created the buffer zone using r.buffer
> d)  patched the landcover map in the buffer zone with r.patch -z
> e)  calculated statistics with r.stat -c
> 
> Thanks.
> 
> M

I think that should work. If you want to sample within a specific buffer distance of your sites however, I wrote a modified version of v.sample called v.sample.buffer (a bash script) which is still not ready for submission or general use, as I have to set it up to run with the GRASS parser interface and write some user documentation, etc. Basically what it does go through the vector points layer site by site and extracts information from one or more raster layers within a user specified buffer radius around the points and adds the calculated results (min, max, mean....) to the attribute table of the sites vector layer. It hasn't gone through any testing yet. If this is what you want to do, I can send you the files (I called a python script in it as I wanted to calculate mode percent). I should have the script in a form good enough to be uploaded on the GRASS wiki site in a month or two if you prefer to wait.

T
-- 
Trevor Wiens 
twiens at interbaun.com

The significant problems that we face cannot be solved at the same 
level of thinking we were at when we created them. 
(Albert Einstein)




More information about the grass-user mailing list