GRASS logo


v.profile - Vector map profiling tool


vector, profile, transect


v.profile --help
v.profile [-cz] input=name [type=string[,string,...]] [where=sql_query] [layer=string] [output=string] [separator=character] [dp=integer] 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]


Do not print column names
Do not print 3D vector data (z values)
Only affects 3D vectors
Allow output files to overwrite existing files
Print usage summary
Verbose module output
Quiet module output
Force launching GUI dialog


input=name [required]
Name of input vector map
Or data source for direct OGR access
Input feature type
Options: point, line
Default: point,line
WHERE conditions of SQL statement without 'where' keyword
Example: income < 1000 and inhab >= 10000
Layer number or name
Use features only from specified layer
Default: 1
Path to output text file or - for stdout
Default: -
Field separator
Special characters: pipe, comma, space, tab, newline
Default: pipe
Number of significant digits
Options: 0-32
Default: 2
buffer=float [required]
Buffer (tolerance) for points in map units
How far points can be from sampling line
Default: 10
Name for profile line and buffer output map
Profile line and buffer around it will be written
Coordinates for profiling line nodes
Specify profiling line vertexes and nodes
Profiling line map
Vector map containing profiling line
WHERE conditions for input profile line map
Use to select only one line from profiling line map
Profiling line map layer
Default: 1

Table of contents


v.profile prints out distance and attributes of points/lines along a profiling line. Distance is calculated from the first profiling line coordinate pair or from the beginning of vector line.
The buffer (tolerance) parameter sets how far 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. The buffer (tolerance) setting does not affect lines. Lines are sampled at their crossing point with profiling line.

By default Z values are printed if 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. As a profiling line must be a single line, the user should use the profile_where parameter to select a single line from a profile input map if it contains multiple vector features.


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 how area sampling should work and why it is important, area (or any other feature type) sampling can be added.


Get point values and distance from the city and save into file for later usage. We will use comma as delimiter and three numbers after decimal separator for distance. Output file will contain data for all points, that are within 100m range to profiling line (Spearfish dataset).
# Spearfish sample dataset
v.profile input=archsites map_output=profiling_line buffer=100 \
          east_north=591518.55,4925722.38,592110.14,4920989.67 \
	  output=archsites_distance.csv dp=3 separator=comma

# Now let's see the output:
cat archsites_distance.csv
1,446.958,24,"Hanson Ranch"
2,1386.149,11,"No Name"
3,2754.872,2,"No Name"
4,4559.578,13,"No Name"

Create river valley crossection and provide river marker:

# Take elevation samples
r.profile input=elevation.dem@PERMANENT output=/home/user/elevation.profile \

# Now get distance to place where river marker should be set
v.profile input=streams@PERMANENT output=river_profile.csv \


Strings are enclosed in double quotes ", still quotes within string are not escaped.

Output does not contain Vector CAT values. Only way how to get CAT value is from the attribute table.

If 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 GIS issue tracker should be opened.




Maris Nartiss

Last changed: $Date: 2017-01-23 18:37:24 +0100 (Mon, 23 Jan 2017) $


Available at: v.profile source code (history)

Main index | Vector index | Topics index | Keywords index | Graphical index | Full index

© 2003-2017 GRASS Development Team, GRASS GIS 7.2.3svn Reference Manual