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. Alternatively the coordinate pairs can be piped from stdin, one comma separated pair per line.
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=space
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,7779800
Example 2
Extract a profile by interactively selecting the profile route from the GRASS
monitor:
r.profile -i input=elev.rast output=profile.pts
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.points
cat saved.points | r.profile input=elev.rast output=profile.pts
With this method the coordinates must be given as space or tab separated easting and northing. Labels after these values are ignored.
Another example using d.where:
d.where | r.profile elevation.dem
Example 4
Pipe coordinates into r.profile
r.profile elevation.dem res=1000 << EOF 591243,4926344 592509,4922156 594100,4920793 599910,4919365 602929,4919235 604844,4918391 606468,4917190 607766,4915664 EOF
To extract the numbers in scripts, following parameters can be used:
r.profile input=dgm12.5 profile=3570631,5763556 2>/dev/null
Last changed: $Date$