d.profile(1)	       Grass User's Manual	     d.profile(1)



NNAAMMEE
       dd..pprrooffiillee   - Displays profiles of a user-specified raster
       map layer.
       _(_G_R_A_S_S _D_i_s_p_l_a_y _P_r_o_g_r_a_m_)

SSYYNNOOPPSSIISS
       dd..pprrooffiillee
       dd..pprrooffiillee rraasstt==_n_a_m_e [ddrraasstt==_n_a_m_e] [pplloottffiillee==_n_a_m_e]

DDEESSCCRRIIPPTTIIOONN
       This command  works  only  interactively.  It  clears  the
       entire  graphics  screen and provides a graphical interac-
       tion allowing the selection of transects  for  which  pro-
       files  are  then generated. Input parameters can be speci-
       fied on the command line for quicker start-up.

UUSSEERR PPRROOMMPPTTSS
       First, you will be presented with a prompt asking  you  to
       choose a raster map layer to be profiled. Then you will be
       prompted for an optional  display  raster.   The  optional
       display	raster	will  be  shown  rather than the profiled
       raster.	This is useful to be  able  to	more  easily  see
       ground  features,  such	as  might be visible in an aerial
       photo or satellite image. Finally, you  will  be  prompted
       for the name prefix for output file(s) containing the pro-
       file data. This is an optional feature.


       After parameters are given, the raster layer will be  dis-
       played  in  the left half of the graphics monitor, and the
       right half will be divided into four  frames.  There  will
       also  be two frames along the top of the monitor: a mouse-
       button menu frame on the left, and a status frame  on  the
       right.


       The  mouse-button menu initially offers you three options:
       Mouse Buttons:

       Left: Where am I?

       Middle: Mark FIRST Point of Profile Line.

       Right: QUIT this.


       You may query the displayed raster map layer by indicating
       points  with  the  left	mouse-button. The coordinates and
       category value of each point that  you  indicate  will  be
       displayed  on  in the status frame.  If you mark the first
       point of the profile line you will be presented	with  the
       following mouse-button menu: Mouse Buttons:

       Left: Where am I?

       Middle: Mark SECOND Point of Profile Line.

       Right: QUIT this.


       Once  you  mark	the second point of the profile line, the
       profile line will be labeled (with a letter from A  to  D)
       and  displayed  in  one	of the four display frames on the
       right hand side of the screen. You will then be	presented
       with a third mouse-button menu: Mouse Buttons:

       Left: DO ANOTHER

       Middle: CLEAR DISPLAY

       Right: QUIT this.


       If  you	would  like to view another profile, click on the
       left mouse-button.  If you would  like  to  redisplay  the
       raster  map  layer  and clear out the four profile frames,
       click on the middle mouse-button. If  you  would  like  to
       quit, then click on the right button.


       If  you	selected the pplloottffiillee option, you will have up to
       four files starting with the _n_a_m_e and followed by a suffix
       of  the	plot  letter  _A_,  _B_, _C_, or _D.  The plots that are
       written to these files reflect the last of each plot  done
       with  that letter (i.e. They will match what's in the dis-
       play when you quit).


       The format of the plot files is not geared toward any par-
       ticular software, but should be easy to coax into a number
       of other programs.  The first  three  lines  contain  some
       header  information about the plot, each prefixed with a #
       sign to denote a comment.  A fourth comment line describes
       the  data  that	follows.   It  consists  of  the distance
       (always in meters), the cell value (in whatever	units  it
       is in), the easting in decimal format, and the northing in
       decimal format.	The number of values will vary	depending
       on  the	length	of  the  profile, cell resolution and the
       slope angle of the profile line.  Below is an example of a
       plotfile:


       # Profile A of elev.ft@snows

       #     From    (702879.29679757,	  4287317.55920185)    to
       (702722.40973589, 4287061.72632285)

       # Stats: Count = 644, Min = 2424.658936, Max = 2513.246094

       # dist value east north

       0.000000 2513.246094 702879.102364 4287317.516912

       0.000000 2513.246094 702878.713496 4287317.118970

       0.556395 2513.246094 702878.324629 4287316.721029

       1.112790 2513.246094 702878.324629 4287316.323088




NNOOTTEESS
       You  might  notice the first two 'dist' values in the pro-
       file output above are both zero.  This is due to the  fact
       the  cell resolution for this file is less than one meter,
       and so the function that calculates the distance considers
       the  distance  between the first cell and the second to be
       zero.  You might also notice, the coordinates given in the
       header and displayed on screen are slightly different from
       the first and last coordinates given in the  profile  data
       output.	This is because the profile data output finds the
       eastings and northings for the center of the  cells  while
       the  coordinate	transformations  from  mouse clicks might
       yield slightly  different  coordinates  which  still  fall
       within  the  same  cell boundaries.  The difference should
       always be less than the distance between  the  center  and
       any  corner  (not  edge!) of the cell at the resolution of
       the profiled raster.


       Only four output plotfiles can be made.	Each time  a  new
       profile is run, the plotfile is immediately written to the
       file _n_a_m_e._l_e_t_t_e_r. One can take advantage of this  fact  to
       create an unlimited number of plotfiles simply by renaming
       the output files before running more profiles.	This  may
       not  always  be	the  case,  but it is at the time of this
       writing.


       Useful enhancements to _d_._p_r_o_f_i_l_e would include:

	      Adding an option to display profiles using category
	      colors, like a bar-chart.

	      Allowing profile lines to be defined by a series of
	      points, not just two.

	      Allowing profiles to be saved in a file, for  later
	      viewing by GRASS.

	      Allowing	the  user to enter profile line points by
	      typing coordinates.


   PPeerrll SSccrriipptt ttoo ccoonnvveerrtt oouuttppuutt ttoo aa ssiittee__lliisstt
       The script below will convert the pplloottffiillee output  to  the
       site_list format.  It probably won't work 100% for lat/lon
       datasets.


       ##!! //uussrr//bbiinn//ppeerrll --ww

       # prof2sites.pl: converts the output  of  d.profile  to	a
       site_list


       mmyy (_$_d_i_s_t, _$_e_l_e_v, _$_e_a_s_t, _$_n_o_r_t_h);


       wwhhiillee ()

       {

       iiff (m/^#/)

       {

       pprriinntt "_$__";

       }

       eellssee

       {

       cchhoommpp;

       (_$_d_i_s_t, _$_e_l_e_v, _$_e_a_s_t, _$_n_o_r_t_h) = sspplliitt / /;

       pprriinntt "_$_e_a_s_t|_$_n_o_r_t_h|_$_e_l_e_v|#1 _$_d_i_s_t @Profile0;

       }

       }


BBUUGGSS
       None known.

AAUUTTHHOORR
       Dave Johnson

	DBA Systems, Inc.  10560 Arrowhead Drive

       Fairfax, Virginia 22030


       Modified  by Eric G. Miller for profile output, support of
       floating  point	rasters,  and  optional  display   raster
       (02-Dec-2000).

       _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_3 _$



GRASS 5.0					     d.profile(1)
