1

I am writing a Python script to process mesh data using PyQIS. I would like to specify the dataset, in groups, and change the color styling. This is easily done through the GUI interface, However, I have not found a way to do this using PyQGIS.

enter image description here

Are the classes to do this part of QgsMeshLayer or do they exist somewhere else in PyQGIS?

1

2 Answers 2

1

For color styling I found that I could define my style first in the QGIS GUI interface and then save that style to a file:

layer.saveNamedStyle('/home/nru/run/style.qml') 

and then add that style to the layer using the stand alone PyQGIS script:

layer.loadNamedStyle(styleMap) current_style = map.layerStyleOverrides() map.setLayerStyleOverrides(current_style) layer.loadNamedStyle(styleMap) 
1

For changing the layer dataset the following can be used:

rs = layer.rendererSettings(). dataset = 1. rs.setActiveScalarDatasetGroup(dataset). layer.setRendererSettings(rs). 

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.