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