v.label(1grass)
π v.label β like, the GRASS User's Manual, but make it make sense π
okay bestie, sit down, hydrate, because today we're talking about v.label, a whole icon from the GRASS User's Manual. she makes paint labels for a vector map, pulling the text straight out of the attributes attached to it. no cap. π
β¨ NAME β¨
v.label β creates paint labels for a vector map from attached attributes. that's the whole job description and she ate. π
π·οΈ KEYWORDS π·οΈ
vector, paint labels
π SYNOPSIS π
v.label
v.label --help
v.label [-ac] [labels=name] map=name column=name
[type=string[,string,...]] [layer=string] [where=sql_query]
[xoffset=float] [yoffset=float] [reference=string[,string,...]]
[font=string] [size=float] [space=float] [fontsize=integer]
[color=name] [rotation=angle] [width=float] [highlight_color=name]
[highlight_width=float] [bgcolor=name] [border=name]
[opaque=yes|no] [--help] [--verbose] [--quiet] [--ui]
π© Flags π©
-aβ rotates the labels so they align with the lines. it's giving "follow the road bestie" π£οΈ-cβ curls the labels along the lines. yes, literally curling. slay.--helpβ prints the usage summary. your emotional support flag π«Ά--verboseβ verbose module output. she's chatty and we love that π¬--quietβ quiet module output. shhh, main character moment π€«--uiβ forces the GUI dialog to launch. fancy girl behavior β¨
π Parameters π
labels=nameβ name for the new paint-label file. if you don't give one, the name of the input map gets used instead. lowkey generous.map=name[required] β name of the vector map. or a data source for direct OGR access.column=name[required] β name of the attribute column used for the labels. this is where the text comes from bestie.type=string[,string,...]β input feature type. options:point,line,boundary,centroid. default:point,line,boundary,centroid(yes, all of them, she's an overachiever).layer=stringβ layer number or name. vector features can hold category values in different layers, and this number decides which layer we're using. when it's direct OGR access, this is the layer name. default:1.where=sql_queryβ WHERE conditions of an SQL statement, nowherekeyword needed. example:income < 1000 and population >= 10000.xoffset=floatβ offsets the label in the x-direction. default:0.yoffset=floatβ offsets the label in the y-direction. default:0.reference=string[,string,...]β reference position. options:center,left,right,upper,lower. default:center.font=stringβ font name. default:standard.size=floatβ label size, in map-units. default:100.space=floatβ space between letters for curled labels, in map-units.fontsize=integerβ label size, in points. options:1-1000.color=nameβ text color. either a standard color name or anR:G:Btriplet. default:black.rotation=angleβ rotation angle in degrees, counter-clockwise. options:0-360. default:0.width=floatβ border width. options:0-25. default:1.highlight_color=nameβ highlight color for the text. either a standard color name, anR:G:Btriplet, or"none". default:none.highlight_width=floatβ width of the highlight coloring. default:0.bgcolor=nameβ background color. either a standard color name, anR:G:Btriplet, or"none". default:none.border=nameβ border color. either a standard color name, anR:G:Btriplet, or"none". default:none.opaque=yes|noβ opaque to vector (only relevant if a background color is selected). options:yes,no. default:yes.
π DESCRIPTION π
so like, v.label makes a label-file from a GRASS vector map, with labels created from attributes in the attached table. and if you don't hand her a label file name? she just uses the name of the source map. self-sufficient queen. π
π NOTES π
if you give her the fontsize option, then the space option gets determined automatically from the current display window. otherwise you should set the space option to be roughly the same as the size option. matching energy, fr fr. β¨
and now, a description of the labels file. buckle up bestie.
the file lives in $MAPSET/paint/labels/. it's a plain-text ASCII file containing these fields:
β οΈ Caution: The following information may be incomplete, out of date, and wrong! β οΈ
not me warning you that the docs might be lying to you π iconic honestly, but also: be careful.
the label information that must be provided in the labels file is:
- TEXT: lines in multiple line labels will appear one above the next. more than one line of text can be specified by notating the end of a line with a
'\n'. (e.g.SPEARFISH\nSOUTH DAKOTA). - LOCATION: determines where the text will be located on the image. the user specifies the easting and northing, and (optionally) specifies a vertical and horizontal offset from the specified easting/northing. these offsets exist so you can place labels more finely, and they're measured in local pixels. so in
d.labelsthe offset is measured in screen pixels, and inps.mapthe offset is measured in PostScript points (i.e. 1/72" steps). - PLACEMENT: determines which part of the label the location refers to. if placement is unspecified, the label is centered (
center), by default. label placement may be specified as:lower left(lower left corner of the text)lower right(lower right corner of the text)lower center(bottom center of the text)upper left(upper left corner of the text)upper right(upper right corner of the text)upper center(top center of the text)center(center of the text)
- FONT: this specifies the font to use.
the following fonts are available for use with d.labels:
cyrilc gothgbt gothgrt gothitt greekc greekcs greekp greeks
italicc italiccs italict romanc romancs romand romans romant
scriptc scripts
alternatively, the path to a FreeType (.ttf) font may be given. (for d.labels only)
the word standard can be used to specify the default font (which is romans).
ngl, ps.map can override this setting and use other fonts. its default font is Helvetica. she's got her own opinions. π
- TEXT SIZE: this determines the size of the letters. the size specifies the vertical height of the letters in meters on the ground. so text will grow or shrink depending on the scale at which the map is drawn. alternatively
fontsizecan set the font size in normal font points. - TEXT COLOR: this selects the text color. if unspecified, the label's text is drawn in
black, by default. the text color can be specified in one of several ways:- By color name:
aqua black blue brown cyan gray green grey indigo magenta orange purple red violet white yellow - As red, green, blue component values. (0-255) for example:
128:100:200 - Specify
"none"to suppress the lettering.
- By color name:
- WIDTH: this determines the line thickness of the border box. the maximum value is
25.0. - HIGHLIGHT COLOR: the text can be highlighted in another color so that it appears to be in two colors. the text is drawn first in this color at a wider line width, and then redrawn in the text color at the regular line width. no highlight color (
"none") is used by default, if unspecified by the user. to specify use of no highlight color, specify"none". (see TEXT COLOR above for a list of permissible color names.) - HIGHLIGHT WIDTH: specifies how far from the text lines (in units of pixels) the highlight color should extend. the default highlight width is set to
0(i.e., no highlight color). - BACKGROUND COLOR: text may be boxed in a solid color by specifying a background color. specify
"none"for no background. the default background color setting, if unspecified by the user, iswhite. (see TEXT COLOR above for a list of permissible color names.) - BORDER COLOR: select a color for the border around the background. specify
"none"to suppress the border. the default border color used, if unspecified, isblack. (see TEXT COLOR above for a list of permissible color names.) - OPAQUE TO VECTORS:
yes|no. this field only has meaning if a background color is selected.yeswill prevent vector lines from entering the background.nowill allow vector lines to enter the background. the default setting, if unspecified by the user, isyes.
π EXAMPLE π
spearfish example with a TrueType font (path may differ, don't come for me):
v.label -a map=roads column=label labels=lroads \
font=/usr/X11R6/lib/X11/fonts/TTF/luximri.ttf
d.vect roads
d.labels lroads
since the label files are simple text files, you can merge them together if you like π«Ά. for example, if you set the label colors based on database attributes using multiple runs with the where option. this example uses the standard UNIX cat program:
cd $MAPSET/paint/labels/
cat file1 file2 file3 file4 > file_all
π SEE ALSO π
d.labels, ps.map
π AUTHORS π
- Philip Verhagen (original
s.label) - Radim Blazek (GRASS 6 port)
- Hamish Bowman (enhancements)
π₯ SOURCE CODE π₯
available at: v.label source code (history)
latest change: Friday May 09 14:33:40 2025 in commit: b356c7e108fcbeca77474c8e83ebec8f1e7b3e4a
Main index | Vector index | Topics index | Keywords index | Graphical index | Full index
Β© 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual
and that's the whole page bestie π this was GRASS 8.5.0, brought to you by the GRASS Development Team, Β© 2003-2026, and honestly? she devoured. go make some labels, you absolute main character. β¨π¦
π¦ 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