~ubuntu-branches/ubuntu/vivid/grass/vivid-proposed

« back to all changes in this revision

Viewing changes to vector/v.colors/v.colors.html

  • Committer: Package Import Robot
  • Author(s): Bas Couwenberg
  • Date: 2015-02-20 23:12:08 UTC
  • mfrom: (8.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20150220231208-1u6qvqm84v430b10
Tags: 7.0.0-1~exp1
* New upstream release.
* Update python-ctypes-ternary.patch to use if/else instead of and/or.
* Drop check4dev patch, rely on upstream check.
* Add build dependency on libpq-dev to grass-dev for libpq-fe.h.
* Drop patches applied upstream, refresh remaining patches.
* Update symlinks for images switched from jpg to png.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<h2>DESCRIPTION</h2>
 
2
 
 
3
<em>v.colors</em> allows creating or modifying color table associated
 
4
with a vector map similarly
 
5
to <em><a href="r.colors.html">r.colors</a></em> for raster maps.
 
6
 
 
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.
 
12
 
 
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
 
15
raster map.
 
16
 
 
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.
 
21
 
 
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.
 
27
 
 
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>.
 
31
 
 
32
<h2>NOTES</h2>
 
33
 
 
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
 
37
items is slow.
 
38
 
 
39
<h2>EXAMPLES</h2>
 
40
 
 
41
<h3>Define color table based on categories</h3>
 
42
 
 
43
Define color table <tt>wave</tt> based on categories from layer 1
 
44
 
 
45
<div class="code"><pre>
 
46
v.colors map=soils_general layer=1 color=wave
 
47
</pre></div>
 
48
 
 
49
<h3>Define color table based on attribute values</h3>
 
50
 
 
51
Define color table <tt>ryg</tt> based on values from attribute
 
52
column <tt>AREA</tt>. Attribute table is linked to layer 1.
 
53
 
 
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
 
57
</pre></div>
 
58
 
 
59
<h3>Define color table stored as RGB values in attribute table</h3>
 
60
  
 
61
Write color values to the attribute table (column <tt>GRASSRGB</tt>)
 
62
instead of creating color table.
 
63
 
 
64
<div class="code"><pre>
 
65
v.colors map=soils_general layer=1 color=wave use=attr column=AREA rgb_column=GRASSRGB
 
66
 
 
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
 
73
</pre></div>
 
74
 
 
75
<h3>Convert RGB attribute values into color table</h3>
 
76
 
 
77
Convert existing RGB values to color table rules.
 
78
 
 
79
<div class="code"><pre>
 
80
v.colors -c map=soils_general rgb_column=GRASSRGB
 
81
</pre></div>
 
82
 
 
83
Note that in this case the vector map has a proper color table
 
84
assigned (check
 
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 preferred
 
87
over RGB values stored in attribute table.
 
88
 
 
89
<h3>Remove existing color table</h3>
 
90
 
 
91
<p>
 
92
Existing color table can be removed by <b>-r</b> flag.
 
93
 
 
94
<div class="code"><pre>
 
95
v.colors -r map=soils_general
 
96
</pre></div>
 
97
 
 
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.
 
101
 
 
102
<div class="code"><pre>
 
103
v.colors.out map=soils_general rules=soils.colr
 
104
v.colors map=soils_general rules=soils.colr
 
105
</pre></div>
 
106
 
 
107
To drop RGB column
 
108
use <em><a href="v.db.dropcolumn.html">v.db.dropcolumn</a></em>.
 
109
 
 
110
<div class="code"><pre>
 
111
v.db.dropcolumn map=soils_general column=GRASSRGB
 
112
</pre></div>
 
113
 
 
114
<h2>SEE ALSO</h2>
 
115
 
 
116
<em>
 
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>
 
123
</em>
 
124
 
 
125
<p>See also wiki
 
126
page <a href="http://grasswiki.osgeo.org/wiki/Color_tables">Color
 
127
tables</a> (from GRASS User Wiki)
 
128
 
 
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.
 
131
 
 
132
<h2>AUTHORS</h2>
 
133
 
 
134
Martin Landa, OSGeoREL, Czech Technical University in Prague, Czech Republic
 
135
 
 
136
<p>
 
137
<i>Last changed: $Date: 2015-02-13 16:16:22 +0100 (Fri, 13 Feb 2015) $</i>