wolfhece.wolf_zi_db

Author: HECE - University of Liege, Pierre Archambeau Date: 2024

Copyright (c) 2024 University of Liege. All rights reserved.

This script and its content are protected by copyright law. Unauthorized copying or distribution of this file, via any medium, is strictly prohibited.

Module Contents

class wolfhece.wolf_zi_db.ColNames_PlansTerriers[source]

Bases: enum.Enum

Inheritance diagram of wolfhece.wolf_zi_db.ColNames_PlansTerriers

Enum for the column names in the database

KEY = 'Clé primaire'[source]
ORIGX = 'Origine x'[source]
ORIGY = 'Origine y'[source]
ENDX = 'Xsup'[source]
ENDY = 'Ysup'[source]
WIDTH = 'Largeur'[source]
HEIGHT = 'Hauteur'[source]
FULLRES = 'Acces'[source]
LOWRES = 'Acces2'[source]
RIVER = 'River'[source]
class wolfhece.wolf_zi_db.ZI_Databse_Elt(origx: float, origy: float, endx: float, endy: float, width: float, height: float, fullpath: pathlib.Path, lowpath: pathlib.Path)[source]

Class to store the database elements

class wolfhece.wolf_zi_db.PlansTerrier(parent=None, idx: str = '', plotted: bool = True, mapviewer=None, rivers: list[str] = ['Vesdre', 'Hoegne'])[source]

Bases: wolfhece.PyVertexvectors.Zones

Inheritance diagram of wolfhece.wolf_zi_db.PlansTerrier

Class to handle the “Plans Terriers” – Black and white scanned tif files from SPW.

Override the Zones class to handle the ‘plans terriers’ contours. In the “myzones” list, the object will store the contours for each river.

Elements will be stored in the self.maps dictionary, with the key being the name of the river and the name of the file.

The textures (images) will be stored in the self.textures dictionary, with the key being the ZI_Databse_Elt object.

In the mapviewer, the user can choose the rivers to display, and the images will be loaded/unloaded on the fly when the user clicks on the map.

During import of the images, the system will apply transparency based on a color and a tolerance, and, if necessary, will replace the other colors with another one (self.color). If self.color is None, no replacement will be done.

Parameters:
  • parent (wx.Window) – The wx parent of the object

  • idx (str) – The index of the object

  • plotted (bool) – If the object is plotted

  • mapviewer (MapViewer) – The mapviewer object

  • rivers (list[str]) – The list of rivers to display

set_tolerance(tol: int)[source]

Set the tolerance for the transparency

Color will be considered transparent if the difference between the color and the transparent color is less than the tolerance.

set_transparent_color(color: list[int, int, int])[source]

Set the transparent color.

Color is a list of 3 integers, representing the RGB color (0 -> 255).

set_color(color: tuple[int, int, int])[source]

Set the color of the image.

As the provided images are black and white, the color will be used to replace the black color.

If the images are not black and white, the color will be used to replace all non-transparent colors.

check_plot()[source]

Activate the plot if the object is initialized

_create_zones()[source]

Create the zones for the selected rivers.

Each river will be a zone, and the vectors will be the contours of the images.

read_db(filename: str | pathlib.Path, sel_rivers: list[str] = None)[source]

Read the database (Excel file) and create the zones and the vectors.

The user will be prompted to select the rivers to display.

_filter_db()[source]
_find_map(x: float, y: float)[source]
load_texture(x: float, y: float, which: Literal[full, low] = 'low')[source]
unload_textture(x: float, y: float)[source]
plot(sx=None, sy=None, xmin=None, ymin=None, xmax=None, ymax=None, size=None)[source]

Dessine les zones