[GRASSLIST:4889] ID given Distance from a given point's ID

Dear all,

Here's a question that I can't seem to resolve myself. I created a
map of randomly spread pixels with r.random and buffered those
with r.buffer. For each pixel of the buffer zone, I am interested in
knowing from which source pixel (pixel ID or x,y) I am closest. One
way to do this is by giving the ID of the point which fall inside a
buffer zone. But how could I do this practically?

Cheers,

Thomas

Thomas Dewez
PhD Student
Dept Geography & Earth Sciences
Brunel University (West London)
Uxbridge UB8 3PH, Mddx
United Kingdom

Phone: +44-(0)1895-203215
Fax: +44-(0)1895-203217

e-mail: thomas.dewez@brunel.ac.uk

Have a look at the
s.voronoi
manpage

sth like this might work for you:

It creates areas of "closeness"
You may "color" your map according to the ID of the nearest point
(catnum option)

so all new points are automatically on their green:-)

#---------snip-------------
r.mapcalc 'roundmap=round(map)' # cause s.voronoi works only with integers
r.to.sites input=roundmap output=roundmap.sites # convert to
# sites as s.voronoi works only with sites
s.voronoi sites=roundmap.sites vect=closest.vect # creates closeness diagrams
v.to.rast input=closest.vect output=closest.rast # optionally convert to
# raster
# you may display and query using
d.rast closest.rast
d.vect closest.vect
d.what.vect closest.vect
#---------snip--------------

kind
regards,
Christoph