r.distance(1)	       Grass User's Manual	    r.distance(1)



NNAAMMEE
       rr..ddiissttaannccee - Locates the closest points between objects in
       two raster maps.

       (GRASS Raster Program)

SSYYNNOOPPSSIISS
       rr..ddiissttaannccee

       rr..ddiissttaannccee hheellpp

       rr..ddiissttaannccee [[--llqq]] mmaappss_=_m_a_p_1_,_m_a_p_2 [ffss_=_n_a_m_e]

DDEESSCCRRIIPPTTIIOONN
       Locates the closest points between "objects" in two raster
       maps.   An  "object" is defined as all the grid cells that
       have the same category number, and  closest  means  having
       the shortest "straight-line" distance.


       The output is an ascii list, one line per pair of objects

		  cat1:cat2:distance:east1:north1:east2:north2


   EExxppllaannaattiioonn::
       ccaatt11   Category number from map1

       ccaatt22   Category number from map2

       ddiissttaannccee
	      The distance in meters between "cat1" and "cat2"

       eeaasstt11,,nnoorrtthh11
	      The  coordinates	of  the grid cell "cat1" which is
	      closest to "cat2"

       eeaasstt22,,nnoorrtthh22
	      The coordinates of the grid cell	"cat2"	which  is
	      closest to "cat1"


CCOOMMMMAANNDD LLIINNEE OOPPTTIIOONNSS
   FFllaaggss::
       --ll     Include category labels in the output

       --qq     Run quietly


   PPaarraammeetteerrss::
       mmaappss   Maps for computing inter-class distances

       ffss     Output field separator Default is a colon (:)


NNOOTTEESS
       The output format lends itself to filtering.  For example,
       to "see" lines connecting each of the  category	pairs  in
       two  maps, filter the output using awk and then into _d_._m_a_p
       graph:


       _r_._d_i_s_t_a_n_c_e    _m_a_p_s_=_m_a_p_1_,_m_a_p_2    _|    _a_w_k    _-_F_:	  _'_{_p_r_i_n_t
       _"_m_o_v_e_"_,_$_4_,_$_5_;_"_d_r_a_w_"_,_$_6_,_$_7_}_' _| _d_._m_a_p_g_r_a_p_h


       To  create a site list of all the "map1" coordinates, fil-
       ter the output into awk and then into _s_._i_n_._a_s_c_i_i:


       _r_._d_i_s_t_a_n_c_e _m_a_p_s_=_m_a_p_1_,_m_a_p_2 _|  _a_w_k  _-_F_:  _'_{_p_r_i_n_t  _$_4_,_$_5_}_'	_|
       _s_._i_n_._a_s_c_i_i _s_i_t_e_s_=_n_a_m_e

SSEEEE AALLSSOO
       _r_._d_r_a_i_n

AAUUTTHHOORR
       Michael	 Shapiro,   U.S.  Army	Construction  Engineering
       Research Laboratory

       _L_a_s_t _c_h_a_n_g_e_d_: _$_D_a_t_e_: _2_0_0_2_/_0_1_/_2_5 _0_5_:_4_5_:_3_4 _$



GRASS 5.0					    r.distance(1)
