Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I want to render an IMG file according to a specific renderer, and export to a jpeg File. I have asked a question about this, and got a satisfactory answer.

The issue now is that I need to write a color configuration file which matches the symbology that is required. My Symbology is supposed to be like this:

enter image description here

Based on this answer, I have found that you can write the colors config file somewhat like this:

40  140 0   3
35  204 9   9
30  255 67  11
25  255 165 0
20  255 246 0
15  54  254 0
10  0   255 209
5   1   127 255
0   4   0   213
-4  133 1   243

My problem is that I don't understand if the given values for the pixels are the lower bound, or the upper bound. I don't know how to specify the ranges according to the symbology that I need.

Where can I Find documentation for Gdaldem's color configuration file? Or alternatively, how can I specify the ranges in the configuration file?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

gdaldem will use the colors of the lookup table at their exact position and it will blend those colours by interpolating between the input values.

so, in your example, the value of 40 will be coloured exactly in 140 0 3 and the value of 35 coloured in 204 9 9, then the "missing" values are interpolated (you can see on the answer that you mentioned that you have a "true" gradient).

I haven't tested, but you could duplicate your values if you want ranges with "sharp" transitions.

40 140 0 3

36 140 0 3

35 204 9 9

31 204 9 9

30 255 67 11

26 255 67 11

share|improve this answer
    
so basically you are saying that I should specify both the upper and lower bound of a class with the same color? –  Devdatta Tengshe Apr 11 at 12:26
    
Thanks, setting both the upper and lower bound of a class with the same color worked for me. –  Devdatta Tengshe Apr 11 at 12:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.