[GRASS-user] square buffeer

Martin Wegmann wegmann at biozentrum.uni-wuerzburg.de
Wed Jun 18 06:14:47 EDT 2008


hello, 

because doing it by hand or with already existing GRASS commands ist too 
tedious, Elshad Shirinov programmed a small module for me which fullfills 
this purpose.

The problem was, that coordinates which has been taken from a corner or center 
of a sampling plot represent in fact a 50x50m or 50x200m plot/transect.

This module (r.buffer.rect) creates an area around the coordinate with defined 
x and y side length and with defined position of the input coordinate.

e.g.: you sampled a 50x50m plot but you took the coordinate (x) of the 
bottom-right corner, hence you need the actual area of your plot (1), that is 
what r.buffer.rect does:

1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 x


hope this module will help other people as well, Martin

P.S.:  I will add it to the GRASS add-on Wiki in the near future, when we 
setup the *.html manual page.



Usage:
 r.buffer.rect input=string output=string keyval=value x=value y=value
   alignment=string [title="phrase"] [--overwrite] [--verbose] [--quiet]

Flags:
 --o   Allow output files to overwrite existing files
 --v   Verbose module output
 --q   Quiet module output

Parameters:
      input   Name of existing raster file
     output   Name for the output raster file
     keyval   Value of relevant pixels in the input raster
          x   Width of the area
          y   Height of the area
  alignment   Alignment of the pixel relative to the rectangle
              options: center,top-left,top-right,bottom-left,bottom-right
      title   Title of the output raster file





On Montag, 16. Juni 2008 16:18:49 Martin Wegmann wrote:
> Hello,
>
> I am looking for a way to create a square buffer for a point vector so that
> each point is in the end the centroid of a square with defined side length.
>
> I though about r.mapcalc statements to grow north-south and west-east and
> then somehow create an area from this square. But I have no idea how to do
> it without a lot of hand-work.
>
> Any idea how to achieve that? Or hints where to find relevant documents.
>
> Martin
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user


-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.c
Type: text/x-csrc
Size: 6268 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-user/attachments/20080618/b5f395de/main.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: text/x-makefile
Size: 176 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-user/attachments/20080618/b5f395de/Makefile.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: buffer.c
Type: text/x-csrc
Size: 985 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-user/attachments/20080618/b5f395de/buffer.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: local_proto.h
Type: text/x-chdr
Size: 355 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-user/attachments/20080618/b5f395de/local_proto.bin


More information about the grass-user mailing list