3
<em>v.colors</em> allows to create or modify color table associated
4
with a vector map similarly
5
to <em><a href="r.colors.html">r.colors</a></em> for raster maps.
7
<p>Color rules are built from features category values
8
(<b>use=cat</b>) or numeric data column (<b>use=attr</b>) defined
9
by <b>column</b> option. For 3D vector maps is allowed to define color
10
rules based on points or centroids z-coordinate (<b>use=z</b>). 3D
11
vector lines are not supported.
13
<p>The <b>raster</b> option allows user to specify a raster map from
14
which to copy the color table, similarly <b>raster_3d</b> option for 3D
17
<p>The <b>rules</b> color table type will cause <em>v.colors</em> to
18
read color table specifications from given file and will build the
19
color table accordingly. See
20
<em><a href="r.colors.html">r.colors</a></em> manual page for details.
22
<p>If the user specifies the <b>-w</b> flag, the current color table
23
file for the input map will not be overwritten. This means that the
24
color table is created only if the vector map does not already have a
25
color table. If this option is not specified, the color table will be
26
created if one does not exist, or modified if it does.
28
<p>Alternatively the color rules can be stored in a string column
29
(<b>rgb_column</b>) by saving the RRR:GGG:BBB values suitable for use
30
with <em><a href="d.vect.html">d.vect</a></em>.
34
For vector maps with a large number of features it's more convenient
35
to store color rules in an attribute column (given by <b>rgb_column</b>)
36
rather then in a color table file. Reading color tables with more then 1000
41
<h3>Define color table based on categories</h3>
43
Define color table <tt>wave</tt> based on categories from layer 1
45
<div class="code"><pre>
46
v.colors map=soils_general layer=1 color=wave
49
<h3>Define color table based on attribute values</h3>
51
Define color table <tt>ryg</tt> based on values from attribute
52
column <tt>AREA</tt>. Attribute table is linked to layer 1.
54
<div class="code"><pre>
55
v.to.db map=soils_general layer=1 option=area column=AREA
56
v.colors map=soils_general layer=1 color=wave use=attr column=AREA
59
<h3>Define color table stored as RGB values in attribute table</h3>
61
Write color values to the attribute table (column <tt>GRASSRGB</tt>)
62
instead of creating color table.
64
<div class="code"><pre>
65
v.colors map=soils_general layer=1 color=wave use=attr column=AREA rgb_column=GRASSRGB
67
# See some GRASSRGB values:
68
v.db.select map=soils_general where="cat < 4"
69
cat|OBJECTID|AREA|PERIMETER|GSLNC250_|GSLNC250_I|GSL_NAME|GRASSRGB
70
1|1|0|164616.125|2|1|NC113|212:42:127
71
2|2|0|30785.529297|3|2|NC096|212:42:127
72
3|3|0|87572.882812|4|3|NC097|212:42:127
75
<h3>Convert RGB attribute values into color table</h3>
77
Convert existing RGB values to color table rules.
79
<div class="code"><pre>
80
v.colors -c map=soils_general rgb_column=GRASSRGB
83
Note that in this case the vector map has a proper color table
85
by <em><a href="v.colors.out.html">v.colors.out</a></em>) together
86
with GRASSRGB attribute column. Also note that color table is prefered
87
over RGB values stored in attribute table.
89
<h3>Remove existing color table</h3>
92
Existing color table can be removed by <b>-r</b> flag.
94
<div class="code"><pre>
95
v.colors -r map=soils_general
98
Before removing color table you can store color rules to the file
99
by <em><a href="v.colors.out.html">v.colors.out</a></em> and later to
100
assign by <b>rules</b> option.
102
<div class="code"><pre>
103
v.colors.out map=soils_general rules=soils.colr
104
v.colors map=soils_general rules=soils.colr
108
use <em><a href="v.db.dropcolumn.html">v.db.dropcolumn</a></em>.
110
<div class="code"><pre>
111
v.db.dropcolumn map=soils_general column=GRASSRGB
117
<a href="d.vect.html">d.vect</a>,
118
<a href="r.colors.html">r.colors</a>,
119
<a href="r.colors.out.html">r.colors.out</a>,
120
<a href="r3.colors.html">r3.colors</a>,
121
<a href="r3.colors.out.html">r3.colors.out</a>,
122
<a href="v.colors.out.html">v.colors.out</a>
126
page <a href="http://grasswiki.osgeo.org/wiki/Color_tables">Color
127
tables</a> (from GRASS User Wiki)
129
<p><a href="http://colorbrewer.org">ColorBrewer</a> is an online tool designed to
130
help people select good color schemes for maps and other graphics.
134
Martin Landa, OSGeoREL, Czech Technical University in Prague, Czech Republic
137
<i>Last changed: $Date: 2014-12-24 11:56:44 +0100 (Wed, 24 Dec 2014) $</i>