Cartography¶
Create categorized renderer from styles¶
Sets a vector layer's renderer to a categorized renderer using matching symbols from a style database. If no style file is specified, symbols from the user's current symbol library are used instead.
A specified expression or field is used to create categories for the renderer. Each category is individually matched to the symbols which exist within the specified QGIS XML style database. Whenever a matching symbol name is found, the category's symbol will be set to this matched symbol.
If desired, outputs can also be tables containing lists of the categories which could not be matched to symbols, and symbols which were not matched to categories.
Parameters¶
Label |
Name |
Type |
Description |
---|---|---|---|
Input layer |
|
[vector: any] |
Vector layer to apply a categorized style to |
Categorize using expression |
|
[expression] |
Field or expression to categorize the features |
Style database (leave blank to use saved symbols) |
|
[file] |
File ( |
Use case-sensitive match to symbol names |
|
[boolean] Default: False |
If True (checked), applies a case sensitive comparison between the categories and symbols names |
Ignore non-alphanumeric characters while matching |
|
[boolean] Default: False |
If True (checked), non-alphanumeric characters in the categories and symbols names will be ignored, allowing greater tolerance during the match. |
Non-matching categories Optional |
|
[table] Default: |
Output table for categories which do not match any symbol in the database. One of:
The file encoding can also be changed here. |
Non-matching symbol names Optional |
|
[table] Default: |
Output table for symbols from the provided style database which do not match any category. One of:
The file encoding can also be changed here. |
Outputs¶
Label |
Name |
Type |
Description |
---|---|---|---|
Non-matching categories |
|
[table] |
Lists categories which could not be matched to any symbol in the provided style database |
Non-matching symbol names |
|
[table] |
Lists symbols from the provided style database which could not match any category |
Categorized layer |
|
[same as input] |
The input vector layer with the categorized style applied. No new layer is output. |
Topological coloring¶
Assigns a color index to polygon features in such a way that no adjacent polygons share the same color index, whilst minimizing the number of colors required.
The algorithm allows choice of method to use when assigning colors.
A minimum number of colors can be specified if desired. The color index is saved to a new attribute named color_id.
The following example shows the algorithm with four different colors chosen; as you can see each color class has the same amount of features.
Parameters¶
Label |
Name |
Type |
Description |
---|---|---|---|
Input layer |
|
[vector: polygon] |
The input polygon layer |
Minimum number of colors |
|
[number] Default: 4 |
The minimum number of colors to assign. Minimum 1, maximum 1000. |
Minimum distance between features |
|
[number] Default: 0.0 |
Prevent nearby (but non-touching) features from being assigned equal colors. Minimum 0.0. |
Balance color assignment |
|
[enumeration] Default: 0 |
Options are:
|
Colored |
|
[vector: polygon] Default: |
Specify the output layer. One of:
The file encoding can also be changed here. |
Outputs¶
Label |
Name |
Type |
Description |
---|---|---|---|
Colored |
|
[vector: polygon] |
Polygon vector layer with an added |