gemgis.utils.parse_categorized_qml
gemgis.utils.parse_categorized_qml#
- gemgis.utils.parse_categorized_qml(qml_name: str) tuple #
Parsing a QGIS style file to retrieve surface color values
- Parameters
qml_name (str) – Path to the QML file, e.g.
qml_name='style.qml'
- Returns
column (str) – Variable indicating after which formation the objects were colored (i.e.
'formation'
)classes (dict) – Dict containing the style attributes for all available objects
New in version 1.0.x.
Example
>>> # Loading Libraries and File >>> import gemgis as gg >>> column, classes = gg.utils.parse_categorized_qml(qml_name='style.qml') >>> column 'formation'
>>> # Inspecting classes >>> classes {'Sand1': {'border_width_map_unit_scale': '3x:0,0,0,0,0,0', 'color': '179,90,42,255', 'joinstyle': 'bevel', 'offset': '0,0', 'offset_map_unit_scale': '3x:0,0,0,0,0,0', 'offset_unit': 'MM', 'outline_color': '102,51,24,255', 'outline_style': 'solid', 'outline_width': '0.26', 'outline_width_unit': 'MM', 'style': 'solid'},....}
See also
build_style_dict
Building style dictionairy from loaded style file
load_surface_colors
Loading surface colors as list
create_surface_color_dict
Creating dict with colors for each formation