DESCRIPTION

Module r.cpt2grass converts GMT color palette (*.cpt) format to GRASS color table format and assigns it to given raster map. Input can be either cpt file given in input option or a URL of the cpt file specified in url option. Specifying URL is particularly useful when using color tables from cpt-city, because many color tables can be quickly tested without downloading the files. When option map is specified r.cpt2grass assigns the color rules to the given raster map. Depending on the values of the original cpt file, it may be advantageous to use the -s to stretch the colors based on the range of values of the map.

NOTES

RGB and HSV models are supported. The expected format of the cpt file is:
# COLOR_MODEL = RGB
value1 R G B value2 R G B
value2 R G B value3 R G B
...
Named colors are not supported.

EXAMPLES

From cpt-city we download a rainfall color table and convert it to GRASS color table. If we don't specify output file, it is printed to standard output:
r.cpt2grass input=rainfall.cpt
0.000 229:180:44
20.000 229:180:44
20.000 242:180:100
40.000 242:180:100
40.000 243:233:119
60.000 243:233:119
60.000 145:206:126
80.000 145:206:126
80.000 67:190:135
100.000 67:190:135
100.000 52:180:133
120.000 52:180:133
120.000 6:155:66
140.000 6:155:66
We set two different elevation color tables - continuous and discrete gradients. We have to stretch the color tables to fit the raster map range:
r.cpt2grass url=http://soliton.vm.bytemark.co.uk/pub/cpt-city/td/DEM_screen.cpt map=elevation -s
r.cpt2grass url=http://soliton.vm.bytemark.co.uk/pub/cpt-city/cb/seq/YlOrBr_09.cpt map=elevation -s
We can display legend:
d.legend raster=elevation labelnum=10 at=5,50,7,10
DEM color table yellow to brown color table

SEE ALSO

r.colors

AUTHORS

Anna Petrasova, NCSU OSGeoREL
Hamish Bowman (original Bash script)

Last changed: $Date$