[GRASS-user] buffer vector within a given area

Annalisa Minelli annagrass6 at gmail.com
Fri Apr 24 10:05:10 EDT 2009


Martin,
after you have done the buffering operation (as Moritz said), and
transformed vector map (buffer_areas) in raster (v.to rast), you can easily
extract only the interested areas by using a mapalgebra operation.. for
example:

if "agri" is the map of your agricultural areas (green map)
and "buff" is the map of the buffer around the vector points

you can type:

r.mapcalc "interested_areas = agri * buff"

all cells with a not-zero value are the interested areas..
(I usually prefer to use NULL rather than ZERO.. if you prefer it too, you
can use r.null to transform ZERO to NULL values)

Hope this helps!

Annalisa



2009/4/23 Martin Schweizer <schweizermartin at students.unibe.ch>

> Hi Moritz
>
> Thanks for your help. The problem is, that not each pixel around a point
> (city) can be used as agricultural land. So I can't simply buffer the
> cities with a circle. To concretize what i mean, i made a picture:
> http://www.fotos-hochladen.net/view/landandcity1hjbk4qy3.jpg in green
> you see the potential agricultural land and the black point is a city....
>
> Thanks a lot
>
> Martin
>
> Moritz Lennert schrieb:
> > On 22/04/09 20:39, Martin Schweizer wrote:
> >> Hi
> >>
> >> I have a question which is a bit complex. Hope i can describe it ;-).
> >>
> >> I have a point-vector layer (the citis) and a raster layer with 1 and
> >> ZERO cells (The potenial agricultural land). One categorie in the vector
> >> layer is the land (Squaremeter) that hast to be cultivated for each
> >> point (city). The question is now: How can I calculate and display,
> >> which cells of the raster map (potential agricultural land) hast to be
> >> cultivated? Must be some sort of buffer or neighbourhood.....?
> >
> > Assuming that this agricultural land is the same in all directions of
> > the city, create a column which contains the radius of the circle that
> > encompasses the land needed (i.e. if my memories of geometry are
> > correct: sqrt(surface/pi) and feed the name of this column to the
> > bufcol= parameter of v.buffer (or feed the formula directly to the
> > bufcol parameter, but this only works if you use a db-backend which
> > has a sqrt function, i.e. PostgreSQL).
> >
> > Moritz
> >
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20090424/af7a5ea8/attachment.html


More information about the grass-user mailing list