The -i flag allows the user for selecting the profile from the GRASS monitor by clicking the left mouse button along the profile; clicking the right mouse button ends the profile.
The profile parameter can be set to comma separated geographic coordinates for profile line endpoints. The interactive flag (-i) overrides this option.
The res parameter sets the distance between each profile point (resolution). The resolution must be provided in GRASS database units (i.e. decimal degrees for Lat Long databases and meters for UTM). By default r.profile uses the resolution of the current GRASS region.
The null parameter can optionally be set to change the character string representing null values.
r.profile -ig input=elev.rast | v.in.ascii output=elev.profile fs=spaceThe 2 column output is compatible with most plotting programs.
The optional RGB output provides the associated GRASS colour value for each profile point.
r.profile input=elev.rast output=profile.pts profile=562517,7779433,562984,7779533,563875,7779800This will extract a profile along the track defined by the three coordinate pairs.
Example 2
Extract a profile by interactively selecting the profile route from the GRASS
monitor:
r.profile -i input=elev.rast output=profile.ptsUse the left mouse button to select the profile route in the GRASS monitor. Use the right mouse button to end the profile.
Example 3
Extract a profile with coordinates provided from standard input or an external file:
First create a points file with d.where
d.where > saved.pointsThen pipe the points file into r.profile
cat saved.points | r.profile input=elev.rast output=profile.ptsThe advantage of this method is that the same profile points can be piped into different GRASS rasters by changing the input parameter.
With this method the coordinates must be given as space or tab seperated easting and northing. Labels after these values are ignored.
To extract the numbers in scripts, following parameters can be used:
r.profile input=dgm12.5 profile=3570631,5763556 2>/dev/nullThis filters out the everything except the numbers.
Last changed: $Date: 2005/09/16 14:58:12 $