mnp.evaluation.qgis_templates

Module Contents

Classes

QgisLayerTemplate

Class for qgis layer file templates. Holds location of template files and methods to find&replace text in a template and to write a template to file.

HSITemplate

For reading the HSI qgis layer template

EnvironmentalFactorTemplate

For reading the environmental factor qgis layer template

PopulationMapTemplate

Template for a species populations map, identifying individual populations, as well as keypopulation/non-keypopulation distinction

LandTypeMapTemplate

Template for categorical land type map

Functions

rand_web_color_hex

get_land_type_color

Return default colour for a SNL Natuurtype beheertype code.

Data

default_land_type_colors

API

mnp.evaluation.qgis_templates.rand_web_color_hex() str

” Generate random color. See: https://blog.stigok.com/2019/06/22/generate-random-color-codes-python.html

mnp.evaluation.qgis_templates.default_land_type_colors = None
mnp.evaluation.qgis_templates.get_land_type_color(land_type_code: str) str

Return default colour for a SNL Natuurtype beheertype code.

land_type_code

class mnp.evaluation.qgis_templates.QgisLayerTemplate

Class for qgis layer file templates. Holds location of template files and methods to find&replace text in a template and to write a template to file.

Initialization

read_template_lines(template_type: str)

Read a template type from file. Currently supported: * abiotic_factor template * hsi template * populations template * land_types

template_type: str

key for reading a specific template from file. Currently supported choices are: [environmental_factor, fraction_key_populations_map, hsi, population_map]

find_replace(key: str, value: str | int)

Find and replace in template lines. Used to modify a template towards a specific species

key: str

target text to replace

value: str | int

replacement text

write_to_file(destination)

Write template to file

destination: str

full path, filename and extension for the template

class mnp.evaluation.qgis_templates.HSITemplate

Bases: mnp.evaluation.qgis_templates.QgisLayerTemplate

For reading the HSI qgis layer template

Initialization

class mnp.evaluation.qgis_templates.EnvironmentalFactorTemplate

Bases: mnp.evaluation.qgis_templates.QgisLayerTemplate

For reading the environmental factor qgis layer template

Initialization

class mnp.evaluation.qgis_templates.PopulationMapTemplate(species_model: mnp.species_models.species_model.SpeciesModel)

Bases: mnp.evaluation.qgis_templates.QgisLayerTemplate

Template for a species populations map, identifying individual populations, as well as keypopulation/non-keypopulation distinction

species_model: SpeciesModel

Instance of SpeciesModel class

Initialization

class mnp.evaluation.qgis_templates.LandTypeMapTemplate(land_type_id_to_code_name: dict)

Bases: mnp.evaluation.qgis_templates.QgisLayerTemplate

Template for categorical land type map

Initialization

land_type_id_to_code_name: dictionary mapping ids in the array to land type code and name

land_type_id_to_code_name {1: “N09.01 Schor en kwelder”, 2: “N12.01 Bloemdijk”}