In reply to:
I am looking for suggestions to solving an application problem.
Given a watershed with three points in it (three lines in a file
in the site_lists directory), I want to be able to add n more points,
and for each one of those points, have GRASS tell me which one of
the three original points it is closest to. Either respond to
grassu-list and I will read it or give me a call. Thanks in advance.
I suppose this is possible in GRASS when you make heavy use of r.distance
and r.mapcalc. But a much more elegant way would be to calculate
the distances by Pythagoras' formula a(2)+b(2)=c(2). You put this
formula in a shellscript that reads from and writes to your site_list,
calculating the Euclidean distance between a given point and your three
base points on the basis of the differences in northings and eastings
(I sure hope you don't want to do this in Lat/Lon). The shortest
distance wins out, and the given point gets assigned the ID of the nearest
base point.
----\_\_\_--\_----\_------\_-------------------- P. Martijn van Leusen --------
\_ \_ \_\_\_\_ \_ Dept of Pre- and Protohistoric Archaeology
\_\_\_ \_ \_ \_ \_ University of Amsterdam, The Netherlands
\_ \_ \_ \_\_ \_ martijn@scanner.frw.uva.nl
--------\_------\_----\_--\_--\_\_\_\_-----------------------------------------