3
This program outputs two or four column (with <b>-g</b>) data to stdout or
4
an ASCII file. The default two column output consists of cumulative profile
5
length and raster value. The optional four column output consists
6
of easting, northing, cumulative profile length, and raster value. Profile
7
end or "turning" points can be set manually with the <b>coordinates</b>
8
argument. The profile resolution, or distance between profile
9
points, is obtained from the current region resolution, or can be manually
10
set with the <b>resolution</b> argument.
13
The <b>coordinates</b> parameter can be set to comma separated geographic
14
coordinates for profile line endpoints.
15
Alternatively the coordinate pairs can be piped from the text file specified
16
by <b>file</b> option, or if set to "-", from <tt>stdin</tt>.
17
In these cases the coordinate pairs should be given one comma separated pair
21
The <b>resolution</b> parameter sets the distance between each profile point
22
(resolution). The resolution must be provided in GRASS database units (i.e.
23
decimal degrees for Lat Long databases and meters for UTM). By default
24
<em>r.profile</em> uses the resolution of the current GRASS region.
27
The <b>null</b> parameter can optionally be set to change the character
28
string representing null values.
31
<h2>OUTPUT FORMAT</h2>
33
The multi column output from <em>r.profile</em> is intended for easy use in
34
other programs. The output can be piped (|) directly into other programs or
35
saved to a file for later use. Output with geographic coordinates (<em>-g</em>)
36
is compatible with <em><a href="v.in.ascii.html">v.in.ascii</a></em> and can
37
be piped direcly into this program.
39
<div class="code"><pre>
40
r.profile -g input=elevation coordinates=... | v.in.ascii output=elevation_profile separator=space
43
The 2 column output is compatible with most plotting programs.
45
The optional RGB output provides the associated GRASS colour value for
48
<p>Option <b>units</b> enables to set units of the profile length output.
49
If the units are not specified, current location units will be used.
50
In case of geographic locations (latitude/longitude), meters are used as default unit.
55
Extract a profile with coordinates provided on the command line:
57
<div class="code"><pre>
58
r.profile input=elevation output=profile_points coordinates=562517,7779433,562984,7779533,563875,7779800
60
This will extract a profile along the track defined by the three coordinate
65
<!-- d.where no longer there
67
Extract a profile with coordinates provided from standard input or an external file:
68
<p>First create a points file with <em><a href="d.where.html">d.where</a></em>
70
<div class="code"><pre>
71
d.where > saved.points
74
Then pipe the points file into r.profile
76
<div class="code"><pre>
77
cat saved.points | r.profile input=elev.rast output=profile.pts file=-
80
The advantage of this method is that the same profile points can be piped
81
into different GRASS rasters by changing the input parameter.
83
With this method the coordinates must be given as space or tab separated
84
easting and northing. Labels after these values are ignored.
86
Another example using d.where:
88
<div class="code"><pre>
89
d.where | r.profile elevation.dem
95
Pipe coordinates into r.profile
96
<div class="code"><pre>
97
r.profile elevation.dem res=1000 file=- << EOF
112
The profile resolution is measured exactly from the supplied end or
113
"turning" point along the profile. The end of a profile segment will be an
114
exact multiple of the profile resolution and will therefore not always match
115
the end point coordinates entered for the segmanet.
117
<p>To extract the numbers in scripts, following parameters can be used:
118
<div class="code"><pre>
119
r.profile input=dgm12.5 coordinates=3570631,5763556 2>/dev/null
122
This filters out the everything except the numbers.
128
<a href="v.in.ascii.html">v.in.ascii</a>,
129
<a href="r.what.html">r.what</a>,
130
<a href="r.transect.html">r.transect</a>,
131
<a href="wxGUI.html">wxGUI profile tool</a>
136
<a href="mailto:bcovill@tekmap.ns.ca">Bob Covill</a>
139
<i>Last changed: $Date: 2014-10-04 21:14:57 +0200 (Sat, 04 Oct 2014) $</i>