[GRASS-user] Determining area of poligon vector layer around circle of points in other vector layer

Hi

I have two vector layers - one with polygons and one with points, both
in UTM 34 S.

Now I would like to calculate the area of the polygons in circles
around the points, i.e. how much area in a 500m circle around the
points is covered by the polygons, and store this in the attribute
table of the point layer.

Is there any easy way of achieving this? If I simply buffer the
points, the circles overlap sometimes and form one polygon, and I want
to have the results for each point - so that doesn't work.

Thanks

Rainer

--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Plant Conservation Unit
Department of Botany
University of Cape Town
Rondebosch 7701
South Africa

Hello Rainer,

On Donnerstag, 12. Juni 2008 19:13:18 Rainer M Krug wrote:

Hi

I have two vector layers - one with polygons and one with points, both
in UTM 34 S.

Now I would like to calculate the area of the polygons in circles
around the points, i.e. how much area in a 500m circle around the
points is covered by the polygons, and store this in the attribute
table of the point layer.

Is there any easy way of achieving this? If I simply buffer the
points, the circles overlap sometimes and form one polygon, and I want
to have the results for each point - so that doesn't work.

perhaps if you create a loop:

v.to.rast your points output=points use=cat

max=`r.info -r "points" | grep max | cut -f2 -d=`

COUNTER=`r.info -r "points" | grep min | cut -f2 -d=`

while [ "$COUNTER" -le "$max" ]; do

  r.mapcalc "tttemp_1 = if(points == "$COUNTER",1,null())"

  r.buffer input=tttemp_1 output=tttemp_buffer distances=100 --o

# your query
# patch result with previous query
# redo it until all patches are analysed

  let "COUNTER=COUNTER+1"

done

hope this helps, Martin

Thanks - that sounds interesting. So there is no way of doing that
without a loop?

Rainer

On Thu, Jun 12, 2008 at 7:25 PM, Martin Wegmann
<wegmann@biozentrum.uni-wuerzburg.de> wrote:

Hello Rainer,

On Donnerstag, 12. Juni 2008 19:13:18 Rainer M Krug wrote:

Hi

I have two vector layers - one with polygons and one with points, both
in UTM 34 S.

Now I would like to calculate the area of the polygons in circles
around the points, i.e. how much area in a 500m circle around the
points is covered by the polygons, and store this in the attribute
table of the point layer.

Is there any easy way of achieving this? If I simply buffer the
points, the circles overlap sometimes and form one polygon, and I want
to have the results for each point - so that doesn't work.

perhaps if you create a loop:

v.to.rast your points output=points use=cat

max=`r.info -r "points" | grep max | cut -f2 -d=`

COUNTER=`r.info -r "points" | grep min | cut -f2 -d=`

while [ "$COUNTER" -le "$max" ]; do

       r.mapcalc "tttemp_1 = if(points == "$COUNTER",1,null())"

       r.buffer input=tttemp_1 output=tttemp_buffer distances=100 --o

# your query
# patch result with previous query
# redo it until all patches are analysed

       let "COUNTER=COUNTER+1"

done

hope this helps, Martin

--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Plant Conservation Unit
Department of Botany
University of Cape Town
Rondebosch 7701
South Africa

Rainer:

Re: Determining area of poligon vector layer around circle of points
in other vector layer

...

Thanks - that sounds interesting. So there is no way of
doing that without a loop?

maybe v.rast.stats, v.what.rast, or v.what.vect helps?

(+ v.buffer/r.buffer)

Hamish