r.profile(1)
β¨ NAME β¨
okay so this is r.profile(1), straight outta the GRASS GIS User's Manual, and it is literally the girl who reads your raster map along whatever line you tell her to. π
It outputs the raster map layer values lying on user-defined line(s). You draw the line, she hands you the numbers. slay. π
π KEYWORDS π
raster, profile, transect π¦
π«Ά SYNOPSIS π«Ά
r.profile
r.profile --help
r.profile [-gc] input=name [output=name]
[coordinates=east,north[,east,north,...]] [file=name]
[resolution=float] [null_value=string] [units=string]
[--overwrite] [--help] [--verbose] [--quiet] [--ui]
π© Flags π©
-gβ outputs easting and northing in the first two columns of a four column output. four columns, bestie. iconic. β¨-cβ outputsRRR:GGG:BBBcolor values for each profile point. cute little colours, obsessed. π--overwriteβ lets output files overwrite existing files. yes she will eat your old file, that's the whole point π--helpβ prints the usage summary. π«Ά--verboseβ verbose module output. she tells you everything. main character energy. π--quietβ quiet module output. she says nothing. mysterious. π--uiβ force launching GUI dialog. pops open a lil window fr fr πͺ
π Parameters π
input=name[required] β name of input raster map. this one is non-negotiable, she needs the map. no map no profile. πoutput=nameβ name of file for output (useoutput=-for stdout). Default:-coordinates=east,north[,east,north,...]β profile coordinate pairs π§file=nameβ name of input file containing coordinate pairs. use instead of the'coordinates'option."-"reads from stdin. πresolution=floatβ resolution along profile (default = current region resolution)null_value=stringβ string representing NULL value. Default:*units=stringβ units. if units are not specified, current project units are used. meters are used by default in geographic (latlon) projects. Options:meters,kilometers,feet,milesπ
π DESCRIPTION π
This program outputs two or four column (four when you use -g) data to stdout or to an ASCII file. no cap.
The default two column output is made of the cumulative profile length and the raster value. βοΈ
The optional four column output is: easting, northing, cumulative profile length, and raster value. she's giving organised.
Profile end or "turning" points can be set manually with the coordinates argument. π§ The profile resolution β that's the distance between profile points β is obtained from the current region resolution, or you can manually set it with the resolution argument.
The coordinates parameter can be set to comma separated geographic coordinates for the profile line endpoints. Alternatively the coordinate pairs can be piped from the text file specified by the file option, or if that's set to "-", from stdin. In these cases the coordinate pairs should be given one comma separated pair per line. π«Ά
The resolution 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. π
π OUTPUT FORMAT π
The multi column output from r.profile is intended for easy use in other programs. The output can be piped (|) directly into other programs or saved to a file for later use. Output with geographic coordinates (-g) is compatible with v.in.ascii and can be piped directly into this program. π₯
r.profile -g input=elevation coordinates=... | v.in.ascii output=elevation_profile separator=space
The 2 column output is compatible with most plotting programs. π
The optional RGB output provides the associated GRASS colour value for each profile point. π
Option units enables you to set units of the profile length output. If the units are not specified, the current coordinate reference system's units will be used. In case of geographic CRS (latitude/longitude), meters are used as the default unit. π
π NOTES π
The profile resolution is measured exactly from the supplied end or "turning" point along the profile. The end of a profile segment will be an exact multiple of the profile resolution and will therefore not always match the end point coordinates entered for the segment. yeah. she rounds. that's just who she is. π
To extract the numbers in scripts, the following parameters can be used: π οΈ
r.profile input=dgm12.5 coordinates=3570631,5763556 2>/dev/null
This filters out everything except the numbers. just the numbers, bestie. β¨
πΈ EXAMPLES πΈ
Extraction of values along profile defined by coordinates (variant 1)
Extract a profile with coordinates (waypoints) provided on the command line (North Carolina data set): πΊοΈ
g.region raster=elevation -p
r.profile -g input=elevation output=profile_points.csv \
coordinates=641712,226095,641546,224138,641546,222048,641049,221186
This will extract a profile along the track defined by the three coordinate pairs. The output file "profile_points.csv" contains east,north,distance,value (here: elevation). ποΈ
Extraction of values along profile defined by coordinates (variant 2)
Coordinate pairs can also be "piped" into r.profile (variant 2a):
r.profile elevation resolution=1000 file=- << EOF
641712,226095
641546,224138
641546,222048
641049,221186
EOF
Coordinate pairs can also be "piped" into r.profile (variant 2b):
echo "641712,226095
641546,224138
641546,222048
641049,221186" > coors.txt
cat coors.txt | r.profile elevation resolution=1000 file=-
The output is printed into the terminal (unless the output parameter is used) and looks as follows:
Using resolution: 1000 [meters]
Output columns:
Along track dist. [meters], Elevation
Approx. transect length: 1964.027749 [meters]
0.000000 84.661507
1000.000000 98.179062
Approx. transect length: 2090.000000 [meters]
1964.027749 83.638138
2964.027749 89.141029
3964.027749 78.497757
Approx. transect length: 995.014070 [meters]
4054.027749 73.988029
she ate that ngl πβ¨
π SEE ALSO π
v.in.ascii, r.what, r.transect, wxGUI profile tool
π AUTHOR π
Bob Covill
πΎ SOURCE CODE πΎ
Available at: r.profile source code (history) π«Ά
Accessed: Saturday Jan 17 05:40:55 2026
Main index | Raster index | Topics index | Keywords index | Graphical index | Full index
Β© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual
okay bestie that's the whole page, every last flag and number, no cap. π
and that's the tea from GRASS 8.4.2 β r.profile(1), manual page r.profile(1), signed off with love. bye bestie, go profile something pretty π¦π
β¨
π¦ where this page comes from
- fedora 44: grass 8.4.2-4.fc44 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms