I'm a bit of a novice to QGIS, so apologies if this is a silly question:

I've scanned a geological map into QGIS, which shows different types of rock in different colours. It's a raster layer, and I'd like to have it work like the elevation layer I've imported from the USGS - that is, for each pixel to have a value (for example, 'chalk') so that I can then tabulate the type of rock on which various features are situated. How do I go about this?

  • It's very difficult with scanned maps, because it's very unlikely that, for example, all of the pixels in the 'chalk' areas will have identical values. You can spend an awful lot of time trying to do what you propose. It might be quicker to trace the geology objects to vector polygons. N.
    – nhopton
    Aug 13, 2015 at 9:51

1 Answer 1


Raster cells can only contain numerical values. You have to check which colour correspond to a ceratin rock value. Depending on the kind of scanning, you either have three band RGB colours, or paletted one band.

You can use the raster calculator to get one new cell value from RGB, or take the paletted values directly.

You can use a categorized style to get the text values into the table of content.

  • Thanks - so how do I actually assign those numerical values to each colour? I've actually gone through by hand and turned each scanned colour into a single actual colour in GIMP.
    – Sam
    Aug 13, 2015 at 10:41
  • If you save in GIMP as paletted, you already have one value for each rock type. If you have saved as RGB, you need the raster calculator to make one new value out of the R, G and B channel for a certain colour. You may need one condition for each rock type.
    – AndreJ
    Aug 13, 2015 at 11:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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