123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- <H2>DESCRIPTION</H2>
- <EM>v.colors</EM> is much like <em>r.colors</em>, but may be used for vector maps.
- You give it a vector map and numeric data column, together with color rules
- like you would do for a raster. It creates a new column in the database with
- R:G:B values suitable for use with '<tt>d.vect -a</tt>'.
- <P>
- How it works: it creates a dummy raster map with the same data range as
- the vector's column then runs <em>r.colors</em> for that temporary map.
- It then uses <em>r.what.colors</em> for each value found by <em>v.db.select</em>
- and uploads it a new column in the vector map's attribute database.
- <P>
- It is planned that this script will be replaced with a C display module which
- renders thematic vector maps directly instead requiring the overhead of
- saving the colors into the DB.
- <P>
- If the target column name given by the <b>rgb_column</b> option does
- not exist, it will be created. The default name is "<tt>GRASSRGB</tt>".
- <h2>EXAMPLES</h2>
- Create a random sample point map, query raster map values for those points,
- and colorize output.
- <div class="code"><pre>
- # Spearfish dataset
- g.region -d
- v.random out=rand5k_elev n=5000
- v.db.addtable map=rand5k_elev column='elevation double precision'
- v.what.rast vector=rand5k_elev raster=elevation.10m column=elevation
- v.colors map=rand5k_elev column=elevation color=bcyr
- # display colorized points map
- d.mon x0
- d.vect -a rand5k_elev
- </pre></div>
- <p>
- Colorizing the roads map in Spearfish:
- <div class="code"><pre>
- g.copy vect=roads,myroads
- echo "1 red
- 2 yellow
- 3 orange
- 4 black
- 5 grey" > colors.txt
- v.colors myroads column=cat rules=colors.txt
- # display colorized roads map
- d.mon x0
- d.vect -a myroads
- </pre></div>
- <P>
- Colorizing a TIN (polygons) generated by <em>v.delaunay</em>:
- <div class="code"><pre>
- # new columns for x,y,z of centroids
- v.db.addtable map=tin \
- columns="east double precision, north double precision, height double precision, GRASSRGB varchar(11)"
- # transfer geometry for colorizing (we need the centroid height)
- v.to.db tin option=coor columns="east,north,height"
- v.db.select tin
- v.colors tin column=height rgb_column=GRASSRGB color=rainbow
- # display colorized triangles
- d.mon x0
- d.vect -a tin
- </pre></div>
- <H2>SEE ALSO</H2>
- <EM>
- <A HREF="d.vect.html">d.vect</a> -z<br>
- <A HREF="r.colors.html">r.colors</A><BR>
- <A HREF="r.colors.stddev.html">r.colors.stddev</A><BR>
- <A HREF="r.what.color.html">r.what.color</A><BR>
- <A HREF="v.db.addcolumn">v.db.addcolumn</A><BR>
- <A HREF="v.db.select.html">v.db.select</A><BR>
- <A HREF="db.execute.html">db.execute</A>
- </EM>
- <H2>AUTHOR</H2>
- Hamish Bowman<BR>
- <i>Dunedin, New Zealand</i>
- <p>
- <i>Last changed: $Date$</i>
|