wolfhece.pywalous ================= .. py:module:: wolfhece.pywalous .. autoapi-nested-parse:: 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 --------------- .. py:data:: HYDROLOGY_LANDUSE_FR .. py:data:: HYDROLOGY_LANDUSE_EN //metawal.wallonie.be/geonetwork/srv/api/records/86462606-4a21-49c8-ab9e-564ccba681b7/attachments/DescriptionLegende_WALOUS_OCS.pdf 1. Revêtement artificiel du sol: cette classe reprend tous les revêtements artificiels du sol de nature peu ou pas perméable (ex béton, le bitume ou les pavés). Ceci comprend le réseau routier, les trottoirs, les terrasses, les parkings (les emplacements de parking semiperméables non végétalisés sont également dans cette catégorie) et les terrains ou pistes de sport en matériaux synthétiques. 2. Constructions artificielles hors sol : cette classe reprend tous les bâtiments et autres constructions s'élevant au-dessus du sol. 3. Réseau ferroviaire : cette classe reprend les rails et ballasts des chemins de fer encore en activité (les RaVEL entre dans la classe 1). Cette classe se différencie de la classe 1 par sa grande perméabilité. 4. Sols nus : cette classe inclut tout type de roche mère n'étant couverte par des végétaux supérieurs à aucun moment de l'année. Ces sols sont soit naturels (roches affleurantes, falaises, berges caillouteuses…), soit générés par l'activité humaine (extraction, sols compactés, coupe à blanc de l'année…) 5. Eaux de surface : cette classe comprend toutes les surfaces d'eau libre, naturelles ou artificielles. Ceci inclut donc à la fois les cours d'eau (rivières, fleuves et canaux) et les plans d'eau (mares, étangs, lacs, bassins de décantation, piscines extérieures). 6. Couvert herbacé en rotation : cette classe reprend les parcelles combinant un couvert herbacé une partie de l'année et un sol nu temporairement mis à nu. On y retrouve toutes les cultures annuelles, ainsi que les prairies temporaires succédant à une culture annuelle. 7. Couvert herbacé continu : cette classe reprend tous les sols recouverts par de la végétation herbacée tout au long de l'année. Cette végétation peut être d'origine naturelle (landes, mégaphorbiaies, tourbières, pelouses naturelles, végétation rudérale recolonisant une friche ou une ancienne coupe à blanc…), agricole (prés et prairies non labourés dans la saison) ou artificielle (jardin, terrains de sport, parcs…) 8. Arbres résineux : cette classe comprend tous les arbres de plus de 3 m (isolés, en haie ou en peuplement) du groupe des résineux (gymnosperme). 9. Arbres feuillus : cette classe comprend tous les arbres de plus de 3 m (isolés, en haie ou en peuplement) du groupe des feuillus (angiosperme). 80. Arbustes résineux : cette classe comprend tous les arbres et arbustes de moins de 3 m (isolés, en haie ou en peuplement) du groupe des résineux (gymnosperme). 90. Arbustes feuillus : cette classe comprend tous les arbres et arbuste de moins de 3 m (isolés, en haie ou en peuplement) du groupe des feuillus (angiosperme). :type: Extrait de https .. py:data:: WALOUS_OCS .. py:data:: WALOUS_OCS_COLORMAP .. py:data:: WALOUS_OCS2MANNING .. py:data:: WALOUS_OCS2HYDROLOGY .. py:data:: WALOUS_UTS_MAJ_NIV1 .. py:data:: WALOUS_UTS_MAJ_NIV2 .. py:data:: WALOUS_UTS_COLORMAP_MAJ_NIV1 .. py:data:: WALOUS_UTS_COLORMAP_MAJ_NIV2 .. py:data:: WALOUS_UTS2MANNING_MAJ_NIV1 .. py:data:: WALOUS_UTS2MANNING_MAJ_NIV2 .. py:function:: get_palette_walous_uts(which: Literal['MAJ_NIV1', 'MAJ_NIV2']) -> wolfhece.PyPalette.wolfpalette Get the palette for WALOUS :return : palette .. py:function:: get_palette_walous_ocs() -> wolfhece.PyPalette.wolfpalette Get the palette for WALOUS OCS :return : palette .. py:function:: update_palette_walous_uts(which: Literal['UTS_MAJ_NIV1', 'UTS_MAJ_NIV2'], pal: wolfhece.PyPalette.wolfpalette) Update the palette for WALOUS MAJ_NIV1 :param pal : palette to update :return : updated palette .. py:function:: update_palette_walous_ocs(pal: wolfhece.PyPalette.wolfpalette) Update the palette for WALOUS OCS :param pal : palette to update :return : updated palette .. py:class:: Walous_data(dir_data: str = '', fn: str = 'WAL_UTS__2018_L72', extension: str = '.shp', bounds: Union[list[float, float, float, float], list[list[float, float], list[float, float]]] = None) La donnée Walous est liée à l'utilisation des sols en Wallonie source : https://geoportail.wallonie.be/walous Cette classe permet la manipulation de la donnée dans le cadre du projet MODREC et plus spécifiquement la distribution d'un coefficient de frottement sur base de la donnée Walous. .. py:attribute:: _dir :value: '' .. py:attribute:: _fn :value: '' .. py:attribute:: _extension :value: '.shp' .. py:attribute:: _gdf :value: None .. py:method:: read(force: bool = False, bounds: Union[list[float, float, float, float], list[list[float, float], list[float, float]]] = None) Read data from file :param force : force to read even read was done before :param bounds : [xmin, ymin, xmax, ymax] or [[xmin, xmax], [ymin, ymax]] .. py:method:: write(fnout: str = 'out_clip.shp') Write _gdf to file :param fnout : output filename .. py:method:: to_file(fn: str = 'out_clip.shp') Alias to write :param fn : output filename .. py:method:: rasterize(bounds: Union[list[float, float, float, float], list[list[float, float], list[float, float]]], layer: Literal['UTS_MAJ_NIV1', 'UTS_MAJ_NIV2'] = 'UTS_MAJ_NIV1', fn_out: str = 'out.tif', pixel_size: float = 0.5, NoData_value: float = -99999.0, num_type=gdal.GDT_Float32) Rasterization of polygon data to tif. :param bounds : [xmin, ymin, xmax, ymax] or [[xmin, xmax], [ymin, ymax]] :param layer : layer to rasterize :param fn_out : output filename :param pixel_size : pixel size :param NoData_value : NoData value :param num_type : type of the number .. py:class:: DlgMapWalous2Manning(parent, title: str = _('Mapping WALOUS value to ...'), which: Literal['UTS_MAJ_NIV1', 'UTS_MAJ_NIV2', 'OCS_MANNING', 'OCS_HYDROLOGY'] = 'UTS_MAJ_NIV1') Bases: :py:obj:`wx.Dialog` .. autoapi-inheritance-diagram:: wolfhece.pywalous.DlgMapWalous2Manning :parts: 1 :private-bases: Modal dialog for mapping WALOUS value to another ones .. py:attribute:: _table .. py:method:: on_ok(event) .. py:method:: on_cancel(event) .. py:method:: get_mapping() -> dict .. py:class:: DlgMapWalousOCS2Manning(parent, title: str = _('Mapping WALOUS value to ...')) Bases: :py:obj:`DlgMapWalous2Manning` .. autoapi-inheritance-diagram:: wolfhece.pywalous.DlgMapWalousOCS2Manning :parts: 1 :private-bases: Modal dialog for mapping WALOUS value to another ones This dialog is used to map WALOUS values to hydrology values. It inherits from DlgMapWalous2Manning and overrides the initialization to set the correct column labels and values. .. py:class:: DlgMapWalous2Hydrology(parent, title: str = _('Mapping WALOUS value to ...')) Bases: :py:obj:`DlgMapWalous2Manning` .. autoapi-inheritance-diagram:: wolfhece.pywalous.DlgMapWalous2Hydrology :parts: 1 :private-bases: Modal dialog for mapping WALOUS value to another ones This dialog is used to map WALOUS values to hydrology values. It inherits from DlgMapWalous2Manning and overrides the initialization to set the correct column labels and values. .. py:class:: Walous_UTS_Legend(*args, **kw) Bases: :py:obj:`wx.Dialog` .. autoapi-inheritance-diagram:: wolfhece.pywalous.Walous_UTS_Legend :parts: 1 :private-bases: Show the legend of WALOUS .. py:attribute:: _text_v1 .. py:attribute:: _text_v2 .. py:attribute:: _legend_v1 .. py:attribute:: _legend_v2 .. py:method:: close() .. py:class:: Walous_OCS_Legend(*args, **kw) Bases: :py:obj:`wx.Dialog` .. autoapi-inheritance-diagram:: wolfhece.pywalous.Walous_OCS_Legend :parts: 1 :private-bases: Show the legend of WALOUS OCS .. py:attribute:: _text .. py:attribute:: _legend .. py:method:: close() .. py:function:: get_array_WALOUS_OCS(fname: pathlib.Path, spatial_res: float, bounds: Union[list[float, float, float, float], list[list[float, float], list[float, float]]]) -> Union[wolfhece.wolf_array.WolfArray, None] Get WALOUS OCS as WolfArray :param fname: path to the WALOUS OCS file :param spatial_res: desired spatial resolution (in m) :param bounds: [xmin, ymin, xmax, ymax] or [[xmin, xmax], [ymin, ymax]] :return: WolfArray or None if error .. py:function:: get_array_WALOUS_OCS_2023_10m(spatial_res: float, bounds: Union[list[float, float, float, float], list[list[float, float], list[float, float]]]) -> Union[wolfhece.wolf_array.WolfArray, None] Get WALOUS OCS 2023 as WolfArray :param spatial_res: desired spatial resolution (in m) :param bounds: [xmin, ymin, xmax, ymax] or [[xmin, xmax], [ymin, ymax]] :return: WolfArray or None if error .. py:function:: get_array_WALOUS_OCS_2023_4m(spatial_res: float, bounds: Union[list[float, float, float, float], list[list[float, float], list[float, float]]]) -> Union[wolfhece.wolf_array.WolfArray, None] Get WALOUS OCS 2023 as WolfArray :param spatial_res: desired spatial resolution (in m) :param bounds: [xmin, ymin, xmax, ymax] or [[xmin, xmax], [ymin, ymax]] :return: WolfArray or None if error .. py:function:: get_array_WALOUS_OCS_2020_10m(spatial_res: float, bounds: Union[list[float, float, float, float], list[list[float, float], list[float, float]]]) -> Union[wolfhece.wolf_array.WolfArray, None] Get WALOUS OCS 2020 as WolfArray :param spatial_res: desired spatial resolution (in m) :param bounds: [xmin, ymin, xmax, ymax] or [[xmin, xmax], [ymin, ymax]] :return: WolfArray or None if error .. py:function:: get_array_WALOUS_OCS_2020_4m(spatial_res: float, bounds: Union[list[float, float, float, float], list[list[float, float], list[float, float]]]) -> Union[wolfhece.wolf_array.WolfArray, None] Get WALOUS OCS 2020 as WolfArray :param spatial_res: desired spatial resolution (in m) :param bounds: [xmin, ymin, xmax, ymax] or [[xmin, xmax], [ymin, ymax]] :return: WolfArray or None if error .. py:function:: get_array_WALOUS_UTS(fname: pathlib.Path, fnout: pathlib.Path, spatial_res: float, bounds: Union[list[float, float, float, float], list[list[float, float], list[float, float]]], which: Literal['UTS_MAJ_NIV1', 'UTS_MAJ_NIV2'] = 'UTS_MAJ_NIV1') -> Union[wolfhece.wolf_array.WolfArray, None] Get WALOUS UTS as WolfArray :param fname: path to the WALOUS UTS file :param spatial_res: desired spatial resolution (in m) :param bounds: [xmin, ymin, xmax, ymax] or [[xmin, xmax], [ymin, ymax]] :param which: which level to use ('UTS_MAJ_NIV1' or 'UTS_MAJ_NIV2') :return: WolfArray or None if error