wolfhece.wolf_vrt
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
- wolfhece.wolf_vrt.create_vrt(wdir: str, fout: str = 'out.vrt', format: str = 'tif')[source]
Agglomération de tous les fichiers .tif dans un layer virtuel .vrt
- Parameters:
wdir (str) – working directory
fout (str) – output file
format (str) – format of the files to process
- wolfhece.wolf_vrt._get_diverged_relative_path(path: pathlib.Path, base: pathlib.Path) pathlib.Path [source]
Get relative path from base to path, even if they only share part of their paths. More general than the next function “_get_relative_path”, especially for not “child/parents paths”
- wolfhece.wolf_vrt._get_relative_path(path: pathlib.Path, base: pathlib.Path)[source]
Get relative path from base to path
- Parameters:
path (Path) – path to get relative path
base (Path) – base path
- wolfhece.wolf_vrt.create_vrt_from_files(files: list[pathlib.Path] = [], fout: pathlib.Path = 'assembly.vrt')[source]
Agglomération de tous les fichiers énumérés dans files dans un layer virtuel .vrt
- Parameters:
files (list[Path]) – list of files to process
fout (Path) – output file
- wolfhece.wolf_vrt.create_vrt_from_files_first_based(files: list[pathlib.Path] = [], fout: pathlib.Path = 'assembly.vrt', Nodata: float = 99999.0)[source]
Agglomération de tous les fichiers énumérés dans files dans un layer virtuel .vrt
Restreint l’emprise et force la résolution sur le premier fichier listé
- wolfhece.wolf_vrt.create_vrt_from_diverged_files(files: list[pathlib.Path] = [], fout: pathlib.Path = 'assembly.vrt')[source]
Agglomération de tous les fichiers énumérés dans files dans un layer virtuel .vrt
- Parameters:
files (list[Path]) – list of files to process
fout (Path) – output file
- wolfhece.wolf_vrt.create_vrt_from_diverged_files_first_based(files: list[pathlib.Path] = [], fout: pathlib.Path = 'assembly.vrt', Nodata: float = 99999.0)[source]
Agglomération de tous les fichiers énumérés dans files dans un layer virtuel .vrt
Restreint l’emprise et force la résolution sur le premier fichier listé
- wolfhece.wolf_vrt.translate_vrt2tif(fn: str, fout: str = None)[source]
Translate vrt file to tif file
- Parameters:
fn – (str) ‘.vrt’ file to translate
fout – (str, optional) ‘.tif’ file out. Defaults to None –> fn+’.tif’
- wolfhece.wolf_vrt.crop_vrt(fn: str, crop: list, fout: str = None)[source]
Crop vrt file
- Parameters:
fn (str) – (str) ‘.vrt’ file to crop
crop (list) – (list) Bounds [[xmin, xmax], [ymin,ymax]] aka [[xLL, xUR], [yLL,yUR]]
fout (str) – (str, optional) ‘.tif’ file out. Defaults to None –> fn+’_crop.tif’
- wolfhece.wolf_vrt.create_contours(files: list[pathlib.Path] = [], fout: pathlib.Path = 'assembly.vec', color_exterior: tuple = (255, 0, 0), color_interior: tuple = (0, 0, 255), width: int = 3, ignore_first: bool = True, create_extern: bool = True, create_intern: bool = True, force_mask_border: bool = True) wolfhece.PyVertexvectors.Zones [source]
Create contour/footprint from files
- Parameters:
files (list[Path]) – list of files to process
fout (Path - if None, no output file) – output file
color_exterior (tuple) – RGB color for exterior contour
color_interior (tuple) – RGB color for interior contour
width (int) – width of the contour
ignore_first (bool) – ignore the first file in the list
create_extern (bool) – create exterior contour
create_intern (bool) – create interior contour
force_mask_border (bool) – force masked data along borders – [0,:], [-1,:], [:,0], [:,-1