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'm working with satellite date namely chlorophyll and sst. Each geophysical parameter generally has standard colours to represent them. I'm importing geotiffs into Qgis and I'm having difficulty finding the colours needed and a way of styling the raster data.

Is there a way to add colour maps when in the raster properties?

Can I show a colour bar in print composer or in the legent for these colours.

I found a way of changing each colour individually but I'm hoping to find a standard range of colours like the pseudocolour palette.

Any help is greatly appreciated.

Regards

share|improve this question
    
Just to clarify, you have a set of value rasters for (say) SST that you wish to render as images using a standardized set of rules? This should be possible, do you have a link to some (say) SST data in GeoTIFF form that we could test? Nick. –  nhopton Jul 27 '12 at 10:37
    
Hi Nick I have rasters generated from the MODIS A sensor and I want to render the raster values with a colour gradient not listed in the style manager in Qgis. The colour gradient for the parameters are generally standard running from blue to red. I don't have a link to the data unfortunately. Thanks for your response. Cheers –  user8083 Jul 27 '12 at 11:29
    
Pity, I was thinking along the lines of a batch process to render a directory full of value rasters in one go using a standard set of rules. I'll have a quick look at some MODIS A data to see if I can make any sense of it, but it's not something I know anything about. Nick. –  nhopton Jul 27 '12 at 11:41
add comment

4 Answers

Many people use Colorbrewer to aid in their color palette selection. Follow the simple instructions to test and export your color scheme. Good luck!

enter image description here

share|improve this answer
    
This looks good it may sort out what I'm trying to do. Thanks for your response cheers. –  user8083 Jul 27 '12 at 11:30
add comment

I guess the way you've found is via the colormap tab? There's a couple of load/save buttons which export the colourmap in a simple text format:

#QGIS Generated Color Map Export File
INTERPOLATION:DISCRETE
0,0,0,255,255,Color entry 1
85,63,0,192,255,Color entry 2

and so on. If you can get your required colour map into that form then you should be able to load it in that dialog. It will then map those colours to the intervals in the dialog.

If you want more control, you might need to create something in the XML format used by the Save and Load Style buttons. This saves the colours and the mapping from values to colours, transparent pixel values, interpolation settings etc. Basically everything in the properties dialogue that relates to style.

share|improve this answer
    
Thanks for that Spacedman I'm looking for an XML colour gradient doc now. Cheers –  user8083 Jul 27 '12 at 11:32
    
@user8083 Please upvote useful answers to reward users for taking the time to answer. –  underdark Jul 28 '12 at 16:23
add comment

It is worth learning and using the 1-Band Colour Table plugin by BC-Consult,

http://www.bc-consult.com/freebies.htm

It will give you a rapid way of styling extensive raster data from satellites. I use it for Landsat and if you look in there you can find various standard colour schemes. Here are a couple of questions related to that;

1-band raster colour table workaround in QGIS

How to change DEM's gradient colour?

share|improve this answer
    
Thanks Willy have downloaded it and I'm having a look at it. Cheers –  user8083 Jul 27 '12 at 11:33
add comment

Most of the SST colour ramps I've seen look pretty garish, like that in the attached picture. If you wanted to try this ramp, you could copy the text below to a file called (say) SSTramp.txt and render one of your SST TIFFs using gdaldem color-relief from under the Raster menu. Raster -> Analysis -> DEM (terrain models), set 'Mode' to 'Color relief' and set 'Color configuration file' to point to SSTramp.txt. I've no idea what the resulting colour TIFF will look like, as it stands the ramp runs from -4 to 40 degrees C, but this can be changed if it doesn't suit your data, as could the colours.

If by some chance this does produce reasonable results it would be simple to use the same colour ramp in a gdaldem color-relief batch process to render a directory full of SST TIFFs using the same rules.

None of the above tested here because I don't have the data to do this, but it might be worth trying. Nick.

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

enter image description here

Added later: In the end I did manage to extract some MODIS L3 SST data with which to test the method. I don't know if the result makes any sort of sense, but it's quite colourful. I prefer the gdaldem color-relief method to other ways of working because it produces GeoTIFF images.

enter image description here

share|improve this answer
    
Thanks guys for all the help I do appreciate it. I've tried the methods above. I'll have to bin the values in the raster as the Chlorophyll-a values are a log scale. I've done what I need manually but it's not ideal. I'll have time later in the week to look at automating it. Cheers –  user8083 Jul 30 '12 at 8:56
    
When you're making colour ramps theft can be a good idea. For Chlorophyll, for example, you could download this image asrc.albany.edu/people/faculty/miller/research/air-sea/images/… (which has a legend) and load it into QGIS. Install the Raster Value plug-in then zoom in on the legend and read off the RGB values for your ramp. You'll only need the values from the first three bands. –  nhopton Jul 30 '12 at 10:16
add comment

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.