[Qgis-user] Color table for raster map

Agustin Lobo Agustin.Lobo at ija.csic.es
Tue Feb 3 01:03:20 PST 2009


Thanks. Then, in order to make, for example, a standard
terrain table, the best is that I make it with R and save
in qgis table format, right? It would be nice having a tool
reproducing the colorbrewer. Perhaps we could do it
through R thanks to manageR. Opinions?

Agus

Peter Ersts wrote:
> Agustin,
> 
> Sorry for my delayed response.
> 
> The three color ramp types are, Exact, Discrete, and Interpolated. 
> Interpolated is the type you are looking for, I has seriously considered 
> changing it to linear.
> 
> If you have two entries in your color table 0 = black 10 = white.
> 0 ,0,0,0,255,Black
> 10,255,255,255,255, White
> 
> Exact will only shade pixel values 0 and 10, all other pixel values will 
> be ignored.
> 
> Discrete is like a bin ( 0 <= pixel < 10 shade as white) so pixel value 
> of 5 would he shaded as white ( 255, 255, 255, 255 )
> 
> Interpolated is basically a linear interpolation between two colors. In 
> this example 5 would be shaded as ( 128, 128, 128, 255 ).  **note, 
> currently the alpha value is always 255 for the interpolated color and 
> should probably be marked as a bug.
> 
> -pete
> 
> Agustin Lobo wrote:
>> Peter,
>>
>> What would be the equivalent rules for a continuous pseudocolor table
>> (i.e., INTERPOLATION::LINEAR ?)
>> Actually, do you have some standard pseudocolor tables (i.e., terrain
>> colors) already made?
>>
>> Thanks
>> Agus
>>
>> 2009/1/14 Peter Ersts <ersts at amnh.org>:
>>  
>>> The easies way is to make a text file (classification.txt) and add 
>>> the color
>>> entries by hand. So the contents of the file will look like:
>>>
>>> INTERPOLATION::EXACT
>>> 11,0,0,255,255,Post-flooding or irrigated croplands (or aquatic)
>>> 14,0,255,0,255,Rainfed croplands
>>> 20,255,0,255,Mosaic cropland (50-70%) / vegetation
>>> (grassland/shrubland/forest) (20-50%)
>>>
>>>
>>> This will set pixels 11 to blue, 14 to green and 20 to red. The 
>>> format is
>>> really basic.
>>> pixel value, red, green, blue, alpha, label (no commas)
>>>
>>> Then on the colormap tab, you can click the "Load color map from file"
>>> button, second one from the top right.
>>>
>>> Eventually it is planned that it will be able to read a variety of 
>>> different
>>> colormap formats.
>>>
>>> -pete
>>>
>>> Agustin Lobo wrote:
>>>    
>>>> I've got a landcover map in raster format (a tif file)
>>>> from GLOBOVER
>>>> (http://postel.mediasfrance.org/en/BIOGEOPHYSICAL-PRODUCTS/Land-Cover/)
>>>> The raster is opened in QGIS as "Single Band Grey"
>>>> How can I set an arbitrary color table? I can see how
>>>> to set a ramp, but this is a classified image, in which
>>>> integer values stand for different types
>>>> i,e,:
>>>> 11    Post-flooding or irrigated croplands (or aquatic)
>>>> 14    Rainfed croplands
>>>> 20    Mosaic cropland (50-70%) / vegetation 
>>>> (grassland/shrubland/forest)
>>>> (20-50%)
>>>>
>>>> for which different colors should be set as in "unique value"
>>>> for vector maps.
>>>>
>>>> Thanks
>>>>
>>>> Agus
>>>>       
> 
> 

-- 
Dr. Agustin Lobo
Institut de Ciencies de la Terra "Jaume Almera" (CSIC)
LLuis Sole Sabaris s/n
08028 Barcelona
Spain
Tel. 34 934095410
Fax. 34 934110012
email: Agustin.Lobo at ija.csic.es
http://www.ija.csic.es/gt/obster



More information about the Qgis-user mailing list