1d.profile(1) Grass User's Manual d.profile(1)
2
3
4
6 d.profile - Interactive profile plotting utility with optional output.
7
9 display
10
12 d.profile
13 d.profile help
14 d.profile rast=string [drast=string] [plotfile=string]
15
16 Parameters:
17 rast=string
18 Raster map to be profiled
19
20 drast=string
21 Optional display raster
22
23 plotfile=string
24 Output profile data to file(s) with prefix 'name'
25
27 This command works only interactively. It clears the entire graphics
28 screen and provides a graphical interaction allowing the selection of
29 transects for which profiles are then generated. Input parameters can
30 be specified on the command line for quicker start-up.
31
33 First, you will be presented with a prompt asking you to choose a
34 raster map layer to be profiled. Then you will be prompted for an
35 optional display raster. The optional display raster will be shown
36 rather than the profiled raster. This is useful to be able to more
37 easily see ground features, such as might be visible in an aerial photo
38 or satellite image. Finally, you will be prompted for the name prefix
39 for output file(s) containing the profile data. This is an optional
40 feature.
41
42 After parameters are given, the raster layer will be displayed in the
43 left half of the graphics monitor, and the right half will be divided
44 into four frames. There will also be two frames along the top of the
45 monitor: a mouse-button menu frame on the left, and a status frame on
46 the right.
47
48 The mouse-button menu initially offers you three options: Mouse But‐
49 tons:
50 Left: Where am I?
51 Middle: Mark FIRST Point of Profile Line.
52 Right: QUIT this.
53
54 You may query the displayed raster map layer by indicating points with
55 the left mouse-button. The coordinates and category value of each point
56 that you indicate will be displayed on in the status frame. If you
57 mark the first point of the profile line you will be presented with the
58 following mouse-button menu: Mouse Buttons:
59 Left: Where am I?
60 Middle: Mark SECOND Point of Profile Line.
61 Right: QUIT this.
62
63 Once you mark the second point of the profile line, the profile line
64 will be labeled (with a letter from A to D) and displayed in one of the
65 four display frames on the right hand side of the screen. You will then
66 be presented with a third mouse-button menu: Mouse Buttons:
67 Left: DO ANOTHER
68 Middle: CLEAR DISPLAY
69 Right: QUIT this.
70
71 If you would like to view another profile, click on the left mouse-but‐
72 ton. If you would like to redisplay the raster map layer and clear out
73 the four profile frames, click on the middle mouse-button. If you would
74 like to quit, then click on the right button.
75
76 If you selected the plotfile option, you will have up to four files
77 starting with the name and followed by a suffix of the plot letter A,
78 B, C, or D. The plots that are written to these files reflect the last
79 of each plot done with that letter (i.e. They will match what's in the
80 display when you quit).
81
82 The format of the plot files is not geared toward any particular soft‐
83 ware, but should be easy to coax into a number of other programs. The
84 first three lines contain some header information about the plot, each
85 prefixed with a # sign to denote a comment. A fourth comment line
86 describes the data that follows. It consists of the distance (always
87 in meters), the cell value (in whatever units it is in), the easting in
88 decimal format, and the northing in decimal format. The number of val‐
89 ues will vary depending on the length of the profile, cell resolution
90 and the slope angle of the profile line. Below is an example of a
91 plotfile:
92
93 # Profile A of elev.ft@snows
94 # From (702879.29679757, 4287317.55920185) to (702722.40973589,
95 4287061.72632285)
96 # Stats: Count = 644, Min = 2424.658936, Max = 2513.246094
97 # dist value east north
98 0.000000 2513.246094 702879.102364 4287317.516912
99 0.000000 2513.246094 702878.713496 4287317.118970
100 0.556395 2513.246094 702878.324629 4287316.721029
101 1.112790 2513.246094 702878.324629 4287316.323088
102
104 You might notice the first two 'dist' values in the profile output
105 above are both zero. This is due to the fact the cell resolution for
106 this file is less than one meter, and so the function that calculates
107 the distance considers the distance between the first cell and the sec‐
108 ond to be zero. You might also notice, the coordinates given in the
109 header and displayed on screen are slightly different from the first
110 and last coordinates given in the profile data output. This is because
111 the profile data output finds the eastings and northings for the center
112 of the cells while the coordinate transformations from mouse clicks
113 might yield slightly different coordinates which still fall within the
114 same cell boundaries. The difference should always be less than the
115 distance between the center and any corner (not edge!) of the cell at
116 the resolution of the profiled raster.
117
118 Only four output plotfiles can be made. Each time a new profile is
119 run, the plotfile is immediately written to the file name.letter. One
120 can take advantage of this fact to create an unlimited number of plot‐
121 files simply by renaming the output files before running more profiles.
122 This may not always be the case, but it is at the time of this writing.
123
124 Useful enhancements to d.profile would include: Adding an option to
125 display profiles using category colors, like a bar-chart. Allowing
126 profile lines to be defined by a series of points, not just two.
127 Allowing profiles to be saved in a file, for later viewing by GRASS.
128 Allowing the user to enter profile line points by typing coordinates.
129
130 Perl Script to convert output to a site_list
131 The script below will convert the plotfile output to the site_list for‐
132 mat. It probably won't work 100% for lat/lon datasets.
133
134 #! /usr/bin/perl -w
135 # prof2sites.pl: converts the output of d.profile to a site_list
136
137 my ($dist, $elev, $east, $north);
138
139 while ()
140 {
141 if (m/^#/)
142 {
143 print "$_";
144 }
145 else
146 {
147 chomp;
148 ($dist, $elev, $east, $north) = split / /;
149 print "$east|$north|$elev|#1 \%$dist \@Profile\n";
150 }
151 }
152
154 None known.
155
157 Dave Johnson
158 DBA Systems, Inc. 10560 Arrowhead Drive
159 Fairfax, Virginia 22030
160
161 Modified by Eric G. Miller for profile output, support of floating
162 point rasters, and optional display raster (02-Dec-2000).
163
164 Last changed: $Date: 2003/04/11 15:07:53 $
165
166 Full index
167
168
169
170GRASS 6.2.2 d.profile(1)