[Qgis-user] Colouring Geological Maps

Richard McDonnell richard.mcdonnell at opw.ie
Mon Dec 12 03:55:11 PST 2022


Hi Grant,
What I meant is that, using the Field calculation you can create new fields for each thing you want to style. In your case you want a field for colour.
Using the field calculator you can set up a script, for example...

CASE
  WHEN "class" = 'Igneous' THEN '#fc9403'
  WHEN "class" = 'Sedimentary ' THEN '#03fc56'
  WHEN "class" = 'Igneous rocks' THEN '#7303fc'
  WHEN "class" = 'Metamorphic' THEN '#fc03e7'
  ELSE '#fc0303'
END

This will then assign a colour to each feature, which you can assign using the
This can be done for a lot of the styling options as I mentioned before.

As I said below, and as you mentioned in your message, this won't be reflected in the Legend, only in the Map. The above probably isn't the solution you are looking for.

Another suggestion is to look into creating a set of Standard Styles stored centrally. When you load a Layer into Qgis you can load these styles as required, which will apply the rules you previously set.

You can also create default styles for a particular layer and every time you load the layer into a Project the style is automatically loaded with the layer. You can do this from in the Layer Properties and going down to the Style Button selecting Save as default

Kind Regards,

Richard


--
Richard McDonnell MSc GIS, FME Certified Professional
FRM Data Management

--
Oifig na nOibreacha Poiblí
Office of Public Works

Sráid Jonathan Swift, Baile Átha Troim, Co na Mí, C15 NX36
Jonathan Swift Street, Trim, Co Meath, C15 NX36
--
M +353 87 688 5964 T +353 46 942 2409
https://gov.ie/opw

--
To send me files larger than 30MB, please use the link below https://filetransfer.opw.ie/filedrop/richard.mcdonnell@opw.ie

Email Disclaimer: https://www.gov.ie/en/organisation-information/439daf-email-disclaimer/

--
MSc GIS, FME Certified Professional

--
Oifig na nOibreacha Poiblí
Office of Public Works

Sráid Jonathan Swift, Baile Átha Troim, Co na Mí, C15 NX36
Jonathan Swift Street, Trim, Co Meath, C15 NX36
--
M +353 87 688 5964 T +353 46 942 2409
https://https://gov.ie/opw<https://www.opw.ie>

--
Email Disclaimer: https://www.gov.ie/en/organisation-information/439daf-email-disclaimer/<https://www.opw.ie/en/disclaimer/>
From: boxerg at iinet.net.au <boxerg at iinet.net.au>
Sent: 12 December 2022 10:24
To: Richard McDonnell <richard.mcdonnell at opw.ie>
Subject: RE: [Qgis-user] Colouring Geological Maps

Hi Richard,

I can colourise the polygons using the color(rgb) algorithm but this does not flow back to the layers panel or the map layout legend.

What do you mean "storing..as a set of attribute values"?

Thanks for your assistance,
Cheers Grant


From: Richard McDonnell <richard.mcdonnell at opw.ie<mailto:richard.mcdonnell at opw.ie>>
Sent: Monday, 12 December 2022 6:18 PM
To: boxerg at iinet.net.au<mailto:boxerg at iinet.net.au>; qgis-user at lists.osgeo.org<mailto:qgis-user at lists.osgeo.org>
Subject: RE: [Qgis-user] Colouring Geological Maps

Morning,
I'm not sure if this is a solution for you, but have you considered using attribution and storing your styling requirements as a set of attribute values. You can do this for Fill Colour, Stroke Thickness, Font, Sizes...etc...
You could build a graphic modeller to add the attribution to your data and then have a single default style, which has all the Styling Variables set to use the new attribution.
The only issue with this is that you won't generate a legend...
Kind Regards,

Richard


--
Richard McDonnell MSc GIS, FME Certified Professional
FRM Data Management

--
Oifig na nOibreacha Poiblí
Office of Public Works

Sráid Jonathan Swift, Baile Átha Troim, Co na Mí, C15 NX36
Jonathan Swift Street, Trim, Co Meath, C15 NX36
--
M +353 87 688 5964 T +353 46 942 2409
https://gov.ie/opw

--
To send me files larger than 30MB, please use the link below https://filetransfer.opw.ie/filedrop/richard.mcdonnell@opw.ie

Email Disclaimer: https://www.gov.ie/en/organisation-information/439daf-email-disclaimer/



--
MSc GIS, FME Certified Professional

--
Oifig na nOibreacha Poiblí
Office of Public Works

Sráid Jonathan Swift, Baile Átha Troim, Co na Mí, C15 NX36
Jonathan Swift Street, Trim, Co Meath, C15 NX36
--
M +353 87 688 5964 T +353 46 942 2409
https://https://gov.ie/opw<https://www.opw.ie>

--
Email Disclaimer: https://www.gov.ie/en/organisation-information/439daf-email-disclaimer/<https://www.opw.ie/en/disclaimer/>

From: QGIS-User <qgis-user-bounces at lists.osgeo.org<mailto:qgis-user-bounces at lists.osgeo.org>> On Behalf Of Grant Boxer via QGIS-User
Sent: 11 December 2022 08:48
To: qgis-user at lists.osgeo.org<mailto:qgis-user at lists.osgeo.org>
Subject: [Qgis-user] Colouring Geological Maps

I am trying to find an easier way of colouring a geological map. The only way I can find to colourise the polygons in both the map window and layers panel - and hence the displayed legend - is to use the rule-based rendering option. Each rule has to be manually styled.

Is there a way to get QGIS to interrogate a text file for styling information? I can't seem to find one anywhere in the algorithms. Aiming to use this in a graphical modeller to automate colourising geological maps. I can use a fixed qml file but that has to be done for each individual map unless you have a wide range of set styles.

Cheers Grant, Perth WA

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20221212/5e1e1903/attachment.htm>


More information about the QGIS-User mailing list