v.profile(1grass)
π v.profile β the vector map profiling tool π
okay bestie, gather round, because this is v.profile from the GRASS User's Manual and it's genuinely SO useful. it's a vector map profiling tool, filed under the keywords vector, profile, transect β yes queen, all three π
β¨ SYNOPSIS β¨
v.profile
v.profile --help
v.profile [-cz] input=name [type=string[,string,...]]
[where=sql_query] [layer=string] [output=string]
[separator=character] [dp=integer] [format=name] buffer=float
[map_output=name] [coordinates=east,north[,east,north,...]]
[profile_map=name] [profile_where=sql_query] [profile_layer=integer]
[--overwrite] [--help] [--verbose] [--quiet] [--ui]
πΈ FLAGS πΈ
-cβ do not print column names. shy output energy, no header, no names π-zβ do not print 3D vector data (z values). note bestie: this only affects 3D vectors π--overwriteβ allow output files to overwrite existing files. it's giving "yes i meant it, replace it" π₯--helpβ print usage summary--verboseβ verbose module output--quietβ quiet module output--uiβ force launching GUI dialog
π¦ PARAMETERS π¦
input=name[required] β name of input vector map. or, plot twist, a data source for direct OGR access β¨type=string[,string,...]β input feature type. options:point,line. default:point,linewhere=sql_queryβ WHERE conditions of SQL statement without 'where' keyword. example:income < 1000 and population >= 10000layer=stringβ layer number or name. use features only from specified layer. default:1output=stringβ path to output text file, or-for stdout. default:-separator=characterβ field separator. special characters:pipe,comma,space,tab,newline. default:pipedp=integerβ number of significant digits. options:0-32. default:2format=nameβ output format. options:plain,csv,json. default:plainplain: plain text with pipe separatorcsv: CSV (Comma Separated Values)json: JSON (JavaScript Object Notation)
buffer=float[required] β buffer (tolerance) for points in map units. how far points can be from the sampling line. default:10map_output=nameβ name for profile line and buffer output map. the profile line and the buffer around it will be written out πcoordinates=east,north[,east,north,...]β coordinates for profiling line nodes. specify profiling line vertices and nodesprofile_map=nameβ profiling line map. a vector map containing the profiling lineprofile_where=sql_queryβ WHERE conditions for input profile line map. use it to select only one line from the profiling line mapprofile_layer=integerβ profiling line map layer. default:1
π DESCRIPTION π
okay so here's the whole vibe. v.profile prints out distance and attributes of points/lines along a profiling line. the distance is calculated from the first profiling line coordinate pair, or from the beginning of the vector line π§
the buffer (tolerance) parameter sets how far a point can be located from a profiling line and still be included in the output data set π
the output map option can be used to visually check which points are profiled β like a little vibe check for your data, bestie. note that the buffer (tolerance) setting does not affect lines. lines are sampled at their crossing point with the profiling line. periodt π
by default, Z values are printed if the input vector is a 3D map. it can be disabled with the -z flag π«Ά
the profiling line can be provided as N,E coordinate pairs or from an input vector map. since a profiling line must be a single line, you should use the profile_where parameter to select a single line from a profile input map if it contains multiple vector features. one line only, main character energy π
β NOTES β
currently the module can profile only points and lines (including 3D ones). areas and other complex features are not supported π if in future users can provide reasonable examples of how area sampling should work and why it is important, area (or any other feature type) sampling can be added. so likeβ¦ if you have a vision, speak up π€
due to bugs in GRASS native buffering algorithms, this module for now depends on GEOS and will not function if GRASS is compiled without GEOS π this restriction will be removed as soon as GRASS native buffer generation is fixed.
π EXAMPLES π
π example one: geonames along NC-96 π
list all geonames along part of road NC-96 (NC Basic dataset). the output will be stored in a file for later usage. we will use comma as delimiter and three numbers after the decimal separator for distance. the output file will contain data for all points that are within 500 m range to the profiling line π
v.profile input=geonames@PERMANENT output=/home/user/NC_96_geonames.csv\
separator=comma dp=3 buffer=500 profile_map=roadsmajor@PERMANENT profile_where=cat=56
now let's see the output:
cat NC_96_geonames.csv
Number,Distance,cat,GEONAMEID,NAME,ASCIINAME,ALTERNATEN,FEATURECLA,FEATURECOD,COUNTRYCOD,CC2,ADMIN1,POPULATION,ELEVATION,GTOPO30,TIMEZONE,MODIFICATI,PPLKEY,SRC_ID,MAINT_ID
1,360.719,26881,4482019,"New Zebulon Elementary School","New Zebulon Elementary School","","S","SCH","US","","NC",0,106,91,"America/Iqaluit","2006-01-15 00:00:00",0,0,0
2,846.806,22026,4476596,"Little River, Township of","Little River, Township of","","A","ADMD","US","","NC",0,0,91,"America/Iqaluit","2006-01-15 00:00:00",0,0,0
3,2027.918,16681,4470608,"Hendricks Pond","Hendricks Pond","","H","RSV","US","","NC",0,0,91,"America/Iqaluit","2006-01-15 00:00:00",0,0,0
4,2027.918,16690,4470622,"Hendricks Dam","Hendricks Dam","","S","DAM","US","","NC",0,0,91,"America/Iqaluit","2006-01-15 00:00:00",0,0,0
5,2999.214,39338,4496159,"Union Chapel","Union Chapel","","","","US","","NC",0,0,96,"America/Iqaluit","2006-01-15 00:00:00",0,0,0
6,3784.992,43034,4500325,"Zebulon Airport","Zebulon Airport","","S","AIRP","US","","NC",0,108,98,"America/Iqaluit","2006-01-15 00:00:00",0,0,0
π example two: river valley crossection + river marker π
create a river valley crossection and provide a river marker (Spearfish dataset):
# Take elevation samples
r.profile input=elevation.dem@PERMANENT output=/home/user/elevation.profile \
profile=600570.27364,4920613.41838,600348.034348,4920840.38617
# Now get distance to place where river marker should be set
v.profile input=streams@PERMANENT output=/home/user/river_profile.csv \
east_north=600570.27364,4920613.41838,600348.034348,4920840.38617
π BUGS π
ngl these are the parts that will humble you a little bit:
- Strings are enclosed in double quotes
", still quotes within string are not escaped π - Output does not contain Vector CAT values. the only way how to get the CAT value is from the attribute table π
- If the sampled feature (point, line) contains multiple attribute entries (has multiple CAT values), only the first one is reported. if this is a limitation in some practical use case, a feature request in GRASS issue tracker should be opened π
π SEE ALSO π
r.profile- Linear Referencing System
π AUTHOR π
Maris Nartiss β icon behavior, we love to see it β¨
π₯ SOURCE CODE π₯
Available at: v.profile source code (history)
Latest change: Sunday Jan 25 10:11:34 2026 in commit: 662eb2196d98b7b68c137e7ec02380a16b8eea64
Main index | Vector index | Topics index | Keywords index | Graphical index | Full index
and that's a wrap bestie!! π«Ά this was the v.profile(1grass) page, straight out of the GRASS User's Manual, Β© 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual π go profile something iconic, you've got this, mwah π
β¨πΈ
π¦ where this page comes from
- alpine 3.24: grass-gis-doc 8.5.0-r1 Β· GPL-2.0-or-later
- ubuntu stonking: grass-doc 8.5.0-1ubuntu1 Β· 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