23.1.1. Cartography

23.1.1.1. Combine style databases

Combines multiple QGIS style databases into a single style database. If items of the same type with the same name exist in different source databases these will be renamed to have unique names in the output combined database.

23.1.1.1.1. Parametros

Etiqueta

Nombre

Tipo

Descripción

Input databases

ENTRADA

[file] [list]

Files containing QGIS style items

Objects to combine

OBJECTS

[enumeration] [list]

Types of style items in the input databases you would like to put in the new database. These can be:

Output style database

SALIDA

[file]

Predeterminado: [Save to temporary file]

Output .XML file combining the selected style items. One of:

  • Save to a Temporary Layer (TEMPORARY_OUTPUT)

  • Guardar a Fichero…

El fichero codificado también puede ser cambiado aquí.

23.1.1.1.2. Salidas

Etiqueta

Nombre

Tipo

Descripción

Color ramp count

COLORRAMPS

[número]

Label settings count

LABELSETTINGS

[número]

Output style database

SALIDA

[file]

Output .XML file combining the selected style items

Symbol count

SYMBOLS

[número]

Text format count

TEXTFORMATS

[número]

23.1.1.1.3. Python code

Algorithm ID: qgis:combinestyles

import processing
processing.run("algorithm_id", {parameter_dictionary})

The algorithm id is displayed when you hover over the algorithm in the Processing Toolbox. The parameter dictionary provides the parameter NAMEs and values. See Utilizar algoritmos de procesamiento desde la consola for details on how to run processing algorithms from the Python console.

23.1.1.2. 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.

23.1.1.2.1. Parametros

Etiqueta

Nombre

Tipo

Descripción

Capa de entrada

ENTRADA

[vector: cualquiera]

Vector layer to apply a categorized style to

Categorize using expression

CAMPO

[expresion]

Field or expression to categorize the features

Style database (leave blank to use saved symbols)

STYLE

[file]

File (.XML) containing the symbols to apply to the input layer categories. The file can be obtained from the Style Manager Share symbols tool. If no file is specified, QGIS local symbols library is used.

Use case-sensitive match to symbol names

CASE_SENSITIVE

[boolean]

Preestablecido: Falso

If True (checked), applies a case sensitive comparison between the categories and symbols names

Ignore non-alphanumeric characters while matching

TOLERANT

[boolean]

Preestablecido: Falso

If True (checked), non-alphanumeric characters in the categories and symbols names will be ignored, allowing greater tolerance during the match.

Non-matching categories

Opcional

NON_MATCHING_CATEGORIES

[table]

Preestablecido: [Saltar salida]

Output table for categories which do not match any symbol in the database. One of:

  • Saltar salida

  • Crear capa temporal (SALIDA_TEMPORAL)

  • Guardar a Fichero…

  • Guardar a Geopackage…

  • Guardar a Tabla PostGIS…

El fichero codificado también puede ser cambiado aquí.

Non-matching symbol names

Opcional

NON_MATCHING_SYMBOLS

[table]

Preestablecido: [Saltar salida]

Output table for symbols from the provided style database which do not match any category. One of:

  • Saltar salida

  • Crear capa temporal (SALIDA_TEMPORAL)

  • Guardar a Fichero…

  • Guardar a Geopackage…

  • Guardar a Tabla PostGIS…

El fichero codificado también puede ser cambiado aquí.

23.1.1.2.2. Salidas

Etiqueta

Nombre

Tipo

Descripción

Non-matching categories

NON_MATCHING_CATEGORIES

[table]

Lists categories which could not be matched to any symbol in the provided style database

Non-matching symbol names

NON_MATCHING_SYMBOLS

[table]

Lists symbols from the provided style database which could not match any category

Categorized layer

SALIDA

[la misma que la entrada]

The input vector layer with the categorized style applied. No new layer is output.

23.1.1.2.3. Python code

Algorithm ID: qgis:categorizeusingstyle

import processing
processing.run("algorithm_id", {parameter_dictionary})

The algorithm id is displayed when you hover over the algorithm in the Processing Toolbox. The parameter dictionary provides the parameter NAMEs and values. See Utilizar algoritmos de procesamiento desde la consola for details on how to run processing algorithms from the Python console.

23.1.1.3. Create style database from project

Extracts all style objects (symbols, color ramps, text formats and label settings) from a QGIS project.

The extracted symbols are saved to a QGIS style database (XML format), which can be managed and imported via the Style Manager dialog.

23.1.1.3.1. Parametros

Etiqueta

Nombre

Tipo

Descripción

Input project (leave blank to use current)

Opcional

ENTRADA

[file]

A QGIS project file to extract the style items from

Objects to extract

OBJECTS

[enumeration] [list]

Types of style items in the input project you would like to put in the new database. These can be:

Output style database

SALIDA

[file]

Predeterminado: [Save to temporary file]

Specify the output .XML file for the selected style items. One of:

  • Save to a Temporary Layer (TEMPORARY_OUTPUT)

  • Guardar a Fichero…

El fichero codificado también puede ser cambiado aquí.

23.1.1.3.2. Salidas

Etiqueta

Nombre

Tipo

Descripción

Color ramp count

COLORRAMPS

[número]

Number of color ramps

Label settings count

LABELSETTINGS

[número]

Number of label settings

Output style database

SALIDA

[file]

Output .XML file for the selected style items

Symbol count

SYMBOLS

[número]

Number of symbols

Text format count

TEXTFORMATS

[número]

Number of text formats

23.1.1.3.3. Python code

Algorithm ID: qgis:stylefromproject

import processing
processing.run("algorithm_id", {parameter_dictionary})

The algorithm id is displayed when you hover over the algorithm in the Processing Toolbox. The parameter dictionary provides the parameter NAMEs and values. See Utilizar algoritmos de procesamiento desde la consola for details on how to run processing algorithms from the Python console.

23.1.1.5. 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.

../../../../_images/topological_color.png

Figura 23.1 Topological colors example

23.1.1.5.1. Parametros

Etiqueta

Nombre

Tipo

Descripción

Capa de entrada

ENTRADA

[vector: polígono]

The input polygon layer

Minimum number of colors

MIN_COLORS

[número]

Default: 4

The minimum number of colors to assign. Minimum 1, maximum 1000.

Minimum distance between features

MIN_DISTANCE

[número]

Preestablecido: 0.0

Prevent nearby (but non-touching) features from being assigned equal colors. Minimum 0.0.

Balance color assignment

BALANCE

[enumeración]

Predeterminado: 0

Options are:

  • 0 — By feature count

    Attempts to assign colors so that the count of features assigned to each individual color index is balanced.

  • 1 — By assigned area

    Assigns colors so that the total area of features assigned to each color is balanced. This mode can be useful to help avoid large features resulting in one of the colors appearing more dominant on a colored map.

  • 2 — By distance between colors

    Assigns colors in order to maximize the distance between features of the same color. This mode helps to create a more uniform distribution of colors across a map.

Colored

SALIDA

[vector: polígono]

Predeterminado: [Crear capa temporal]

Especificar la capa saliente. una de:

  • Crear capa temporal (SALIDA_TEMPORAL)

  • Guardar a Fichero…

  • Guardar a Geopackage…

  • Guardar a Tabla PostGIS…

El fichero codificado también puede ser cambiado aquí.

23.1.1.5.2. Salidas

Etiqueta

Nombre

Tipo

Descripción

Colored

SALIDA

[vector: polígono]

Polygon vector layer with an added color_id column

23.1.1.5.3. Python code

Algorithm ID: qgis:topologicalcoloring

import processing
processing.run("algorithm_id", {parameter_dictionary})

The algorithm id is displayed when you hover over the algorithm in the Processing Toolbox. The parameter dictionary provides the parameter NAMEs and values. See Utilizar algoritmos de procesamiento desde la consola for details on how to run processing algorithms from the Python console.