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

Martin Wegmann wegmann at biozentrum.uni-wuerzburg.de
Thu Jun 12 13:25:26 EDT 2008


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




More information about the grass-user mailing list