1r.profile(1) Grass User's Manual r.profile(1)
2
3
4
6 r.profile - Outputs the raster map layer values lying on user-defined
7 line(s).
8
10 raster
11
13 r.profile
14 r.profile help
15 r.profile [-igc] input=name [output=string] [pro‐
16 file=east,north[,east,north,...]] [res=float] [null=string]
17 [--verbose] [--quiet]
18
19 Flags:
20 -i
21 Interactively select End-Points
22
23 -g
24 Output easting and northing in first two columns of four column
25 output
26
27 -c
28 Output RRR:GGG:BBB color values for each profile point
29
30 --verbose
31 Verbose module output
32
33 --quiet
34 Quiet module output
35
36 Parameters:
37 input=name
38 Name of input raster map
39
40 output=string
41 Name of file for output (use output=- for stdout)
42 Default: -
43
44 profile=east,north[,east,north,...]
45 Profile coordinate pairs
46
47 res=float
48 Resolution along profile (default = current region resolution)
49
50 null=string
51 Character to represent no data cell
52 Default: *
53
55 This program outputs two or four column (with -g) data to stdout or an
56 ASCII file. The default two column output consists of cumulative pro‐
57 file length (in meters) and raster value. The optional four column out‐
58 put consists of easting, northing, cumlative profile length (m), and
59 raster value. Profile end or "turning" points can be set manually with
60 the profile argument or selected interactively from the GRASS monitor
61 by setting the -i flag. The profile resolution, or distance between
62 profile points, is obtained from the current region resolution, or can
63 be manually set with the res argument.
64
65 The -i flag allows the user for selecting the profile from the GRASS
66 monitor by clicking the left mouse button along the profile; clicking
67 the right mouse button ends the profile.
68
69 The profile parameter can be set to comma separated geographic coordi‐
70 nates for profile line endpoints. The interactive flag (-i) overrides
71 this option. Alternatively the coordinate pairs can be piped from
72 stdin, one comma separated pair per line.
73
74 The res parameter sets the distance between each profile point (resolu‐
75 tion). The resolution must be provided in GRASS database units (i.e.
76 decimal degrees for Lat Long databases and meters for UTM). By default
77 r.profile uses the resolution of the current GRASS region.
78
79 The null parameter can optionally be set to change the character string
80 representing null values.
81
83 The multi column output from r.profile is intended for easy use in
84 other programs. The output can be piped (|) directly into other pro‐
85 grams or saved to a file for later use. Output with geographic coordi‐
86 nates (-g) is compatible with v.in.ascii and can be piped direcly into
87 this program.
88 r.profile -ig input=elev.rast | v.in.ascii output=elev.profile fs=space
89 The 2 column output is compatible with most plotting programs.
90
91 The optional RGB output provides the associated GRASS colour value for
92 each profile point.
93
95 Example 1
96 Extract a profile with coordinates provided on the command line:
97 r.profile input=elev.rast output=profile.pts pro‐
98 file=562517,7779433,562984,7779533,563875,7779800
99 This will extract a profile along the track defined by the three coor‐
100 dinate pairs.
101
102 Example 2
103 Extract a profile by interactively selecting the profile route from the
104 GRASS monitor:
105 r.profile -i input=elev.rast output=profile.pts
106 Use the left mouse button to select the profile route in the GRASS
107 monitor. Use the right mouse button to end the profile.
108
109 Example 3
110 Extract a profile with coordinates provided from standard input or an
111 external file:
112
113 First create a points file with d.where
114 d.where > saved.points
115 Then pipe the points file into r.profile
116 cat saved.points | r.profile input=elev.rast output=profile.pts
117 The advantage of this method is that the same profile points can be
118 piped into different GRASS rasters by changing the input parameter.
119
120 With this method the coordinates must be given as space or tab seper‐
121 ated easting and northing. Labels after these values are ignored.
122
123 Another example using d.where:
124 d.where | r.profile elevation.dem
125
126
127 Example 4
128 Pipe coordinates into r.profile
129 r.profile elevation.dem res=1000 << EOF
130 591243,4926344
131 592509,4922156
132 594100,4920793
133 599910,4919365
134 602929,4919235
135 604844,4918391
136 606468,4917190
137 607766,4915664
138 EOF
139
140
142 The profile resolution is measured exactly from the supplied end or
143 "turning" point along the profile. The end of a profile segment will be
144 an exact multiple of the profile resolution and will therefore not
145 always match the end point coordinates entered for the segmanet.
146
147 To extract the numbers in scripts, following parameters can be used:
148 r.profile input=dgm12.5 profile=3570631,5763556 2>/dev/null
149 This filters out the everything except the numbers.
150
152 v.in.ascii, d.where, d.profile, r.what, r.transect
153
155 Bob Covill
156
157 Last changed: $Date: 2006-12-20 15:00:17 +0100 (Wed, 20 Dec 2006) $
158
159 Full index
160
161 © 2003-2008 GRASS Development Team
162
163
164
165GRASS 6.3.0 r.profile(1)