[GIS] How to color-code geology maps with given CMYK colors

attribute-tablecolorgeologyqgis

I'm trying to understand whether it is possible to corectly display colours in British Geological Survey maps. Our client has a licence to use the shapefiles but unfortunately BGS don't provide SDL files. In theory, the information to correctly colour each formation is available in the shapefile attribute table so I'm wondering whether some python coding would do the trick.

There is a field that assigns the formation (LEX_RCS) type to each polygon so this is the field you read to colour the polygon. Then there is a field (BGSREF) that assigns the colour to that field. The BGSREF field is a 3 digit field (YCM – Yellow Cyan Magenta). Each digit is from 0 to 9 assigning a percentage of that colour (i.e. 0 is 7%, 1 is 14 % … 9 is 100%). Therefore, by reading the BGSREF field, you can then assign the colour to the LEX_RCS field for that polygon.

From what I can see, the symbology properties do not allow for this in QGIS 2.0 so I'm wondering whether some python coding would do it.

Regards
Antonio

Best Answer

It might well be possible with QGIS 2.0 to do this. In the Style->Symbol Selector you can choose Data defined properties There you can assign the color based on an expression which also can calculate based on different schemes, CMYK among others. You would have to transform your values to a format accepted as input there.

CMYK as input for data defined properties Source: https://gis.stackexchange.com/a/60467/9839 (Thanks @NathanW)

Related Question