1v.label(1) GRASS GIS User's Manual v.label(1)
2
3
4
6 v.label - Creates paint labels for a vector map from attached
7 attributes.
8
10 vector, paint labels
11
13 v.label
14 v.label --help
15 v.label [-ac] [labels=name] map=name column=name
16 [type=string[,string,...]] [layer=string] [where=sql_query]
17 [xoffset=float] [yoffset=float] [reference=string[,string,...]]
18 [font=string] [size=float] [space=float] [fontsize=integer]
19 [color=name] [rotation=angle] [width=float] [high‐
20 light_color=name] [highlight_width=float] [bgcolor=name] [bor‐
21 der=name] [opaque=yes|no] [--help] [--verbose] [--quiet] [--ui]
22
23 Flags:
24 -a
25 Rotate labels to align with lines
26
27 -c
28 Curl labels along lines
29
30 --help
31 Print usage summary
32
33 --verbose
34 Verbose module output
35
36 --quiet
37 Quiet module output
38
39 --ui
40 Force launching GUI dialog
41
42 Parameters:
43 labels=name
44 Name for new paint-label file
45 If not given the name of the input map is used
46
47 map=name [required]
48 Name of vector map
49 Or data source for direct OGR access
50
51 column=name [required]
52 Name of attribute column to be used for labels
53
54 type=string[,string,...]
55 Input feature type
56 Options: point, line, boundary, centroid
57 Default: point,line,boundary,centroid
58
59 layer=string
60 Layer number or name
61 Vector features can have category values in different layers. This
62 number determines which layer to use. When used with direct OGR
63 access this is the layer name.
64 Default: 1
65
66 where=sql_query
67 WHERE conditions of SQL statement without ’where’ keyword
68 Example: income < 1000 and population >= 10000
69
70 xoffset=float
71 Offset label in x-direction
72 Default: 0
73
74 yoffset=float
75 Offset label in y-direction
76 Default: 0
77
78 reference=string[,string,...]
79 Reference position
80 Options: center, left, right, upper, lower
81 Default: center
82
83 font=string
84 Font name
85 Default: standard
86
87 size=float
88 Label size (in map-units)
89 Default: 100
90
91 space=float
92 Space between letters for curled labels (in map-units)
93
94 fontsize=integer
95 Label size (in points)
96 Options: 1-1000
97
98 color=name
99 Text color
100 Either a standard color name or R:G:B triplet
101 Default: black
102
103 rotation=angle
104 Rotation angle in degrees (counter-clockwise)
105 Options: 0-360
106 Default: 0
107
108 width=float
109 Border width
110 Options: 0-25
111 Default: 1
112
113 highlight_color=name
114 Highlight color for text
115 Either a standard color name, R:G:B triplet, or "none"
116 Default: none
117
118 highlight_width=float
119 Width of highlight coloring
120 Default: 0
121
122 bgcolor=name
123 Background color
124 Either a standard color name, R:G:B triplet, or "none"
125 Default: none
126
127 border=name
128 Border color
129 Either a standard color name, R:G:B triplet, or "none"
130 Default: none
131
132 opaque=yes|no
133 Opaque to vector (only relevant if background color is selected)
134 Options: yes, no
135 Default: yes
136
138 v.label makes a label-file from a GRASS vector map with labels created
139 from attributes in the attached table. If no label file name is given,
140 the name of the source map is used.
141
143 If the fontsize option is given then the space option is determined
144 automatically from the current display window, otherwise the space
145 option should be set roughly the same as the size option.
146
147 A description of the labels file follows.
148
149 The file is located in $MAPSET/paint/labels/. The file is a plain-text
150 ASCII file containing the following fields:
151
152 Caution: The following information may be incomplete, out of date, and
153 wrong!
154 The label information that must be provided in the labels file is:
155
156 TEXT:
157 Lines in multiple line labels will appear one above the next. More
158 than one line of text can be specified by notating the end of a
159 line with a ’\n’.
160 (e.g. SPEARFISH\nSOUTH DAKOTA).
161
162 LOCATION:
163 Determines where the text will be located on the image. The user
164 specifies the easting and northing, and (optionally) specifies a
165 vertical and horizontal offset from the specified easting/northing.
166 These offsets are provided to allow finer placement of labels and
167 are measured in local pixels. Thus in d.labels the offset is mea‐
168 sured in screen pixels, and in ps.map the offset is measured in
169 PostScript points (i.e. 1/72" steps).
170
171 PLACEMENT:
172 Determines which part of the label to which the location refers.
173 If placement is unspecified, the label is centered (center), by
174 default. Label placement may be specified as:
175 lower left (lower left corner of the text)
176 lower right (lower right corner of the text)
177 lower center (bottom center of the text)
178 upper left (upper left corner of the text)
179 upper right (upper right corner of the text)
180 upper center (top center of the text)
181 center (center of the text)
182
183 FONT:
184 This specifies the font to use.
185
186 The following fonts are available for use with d.labels:
187
188 cyrilc gothgbt gothgrt gothitt greekc greekcs greekp greeks
189 italicc italiccs italict romanc romancs romand romans romant
190 scriptc scripts
191
192 Alternatively the path to a FreeType (.ttf) font may be given. (for
193 d.labels only)
194
195 The word standard can be used to specify the default font (which is
196 romans).
197
198 Note ps.map can override this setting to use other fonts. Its default
199 font is Helvetica.
200
201 TEXT SIZE:
202 This determines the size of the letters. The size specifies the
203 vertical height of the letters in meters on the ground. Thus text
204 will grow or shrink depending on the scale at which the map is
205 drawn. Alternatively fontsize can set the font size in normal font
206 points.
207
208 TEXT COLOR:
209 This selects the text color. If unspecified, the label’s text is
210 drawn in black, by default. The text color can be specified in one
211 of several ways:
212
213 1 By color name:
214 aqua black blue brown cyan gray green grey indigo magenta orange
215 purple red violet white yellow
216
217 2 As red, green, blue component values. (0-255)
218 for example: 128:100:200
219
220 3 Specify "none" to suppress the lettering.
221
222 WIDTH:
223 This determines the line thickness of the border box.
224 The maximum value is 25.0.
225
226 HIGHLIGHT COLOR:
227 The text can be highlighted in another color so that it appears to
228 be in two colors. The text is drawn first in this color at a wider
229 line width, and then redrawn in the text color at the regular line
230 width. No highlight color ("none") is used by default, if unspeci‐
231 fied by the user. To specify use of no highlight color, specify
232 "none". (See TEXT COLOR above for a list of permissible color
233 names.)
234
235 HIGHLIGHT WIDTH:
236 Specifies how far from the text lines (in units of pixels) the
237 highlight color should extend. The default highlight width is set
238 to 0 (i.e., no highlight color).
239
240 BACKGROUND COLOR:
241 Text may be boxed in a solid color by specifying a background
242 color. Specify "none" for no background. The default background
243 color setting, if unspecified by the user, is white. (See TEXT
244 COLOR above for a list of permissible color names.)
245
246 BORDER COLOR:
247 Select a color for the border around the background. Specify
248 "none" to suppress the border. The default border color used, if
249 unspecified, is black. (See TEXT COLOR above for a list of permis‐
250 sible color names.)
251
252 OPAQUE TO VECTORS:
253 yes|no. This field only has meaning if a background color is
254 selected. yes will prevent vector lines from entering the back‐
255 ground. no will allow vector lines to enter the background. The
256 default setting, if unspecified by the user, is yes.
257
259 Spearfish example with TrueType font (path may differ):
260 v.label -a map=roads column=label labels=lroads \
261 font=/usr/X11R6/lib/X11/fonts/TTF/luximri.ttf
262 d.vect roads
263 d.labels lroads
264 Since the label files are simple text files, you can merge them
265 together if you like. For example if you set the label colors based on
266 database attributes using multiple runs with the where option. This
267 example uses the standard UNIX cat program.
268 cd $MAPSET/paint/labels/
269 cat file1 file2 file3 file4 > file_all
270
272 d.labels, ps.map
273
275 Philip Verhagen (original s.label)
276 Radim Blazek (GRASS 6 port)
277 Hamish Bowman (enhancements)
278
280 Available at: v.label source code (history)
281
282 Main index | Vector index | Topics index | Keywords index | Graphical
283 index | Full index
284
285 © 2003-2020 GRASS Development Team, GRASS GIS 7.8.5 Reference Manual
286
287
288
289GRASS 7.8.5 v.label(1)