4.1 r.colors problem

Susan Huse sue at ced.berkeley.edu
Wed Jul 21 14:59:52 EDT 1993


> From grass-lists-owner at max.cecer.army.mil Wed Jul 21 11:22:00 1993
> From: klita at ulysses.sis.ualberta.ca (Deborah Klita)
> Subject: 4.1 r.colors problem
> Sender: grass-lists-owner at max.cecer.army.mil
> Reply-To: grassu-list at max.cecer.army.mil
> To: grassu-list at max.cecer.army.mil
> Date: Wed, 21 Jul 1993 12:13:04 (MDT)
> X-Mailer: ELM [version 2.4 PL17]
> Content-Type> : > text> 
> Content-Length: 646
> 
> My colleague is experiencing some grief when using GRASS4.1 "r.colors" to create
> his own colortable using the flag "color=rules". It seems that the program will
> not recognize equal color number values for any category value, and the result
> is a colortable of wrapped and incomplete lines.
> 
> For example,
> 
> % 1 3
> 1:255 2:200
> 2:200 3:150
> 
> was entered as
> 
> 1 255 255 255
> 2 200 200 200
> 3 150 150 150    
> end
> 
> Any suggestions as to what is wrong with our input or the program?  We really
> would like to use this program with color values of equal intensity.
> 
> Deborah Klita
> Spatial Information Systems Lab
> University of Alberta, Edmonton, Alberta, CANADA 
> 

Actually you did get what you asked for.  This colortable should display
correctly.  GRASS colr files have different formats depending on whether
the colors are specified as a ramp between categories or whether it
reads each category distinctly.  The format r.colors wrote in this case 
is a ramping format.  

You didn't lose rgb, instead GRASS abbreviated.  If there is only one
value, GRASS interprets it as equal value for red, green and blue.

In other words your colr file means:


>% 1 3
	first category 1, last category 3

>1:255 2:200
	ramp from category 1 with a value of 255 255 255 to
	category 2 with a value of 200 200 200

>2:200 3:150
	ramp from category 2 with a value of 200 200 200 to
	category 3 with a value of 150 150 150
	

It may seem a little silly to ramp from 1 to 2, and 2 to 3, but
it is valid.


Sue Huse
REGIS
Univ Calif Berkeley



More information about the grass-user mailing list