wolfhece.PyPictures

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.PyPictures.find_gps_in_file(picture: str | pathlib.Path) tuple[float, float, float][source]

Find GPS coordinates in the picture file. Returns a tuple (latitude, longitude, altitude). If not found, returns (None, None, None).

wolfhece.PyPictures.find_exif_in_file(picture: str | pathlib.Path) dict[source]

Find EXIF data in the picture file. Returns a dictionary of EXIF data. If not found, returns an empty dictionary.

wolfhece.PyPictures.find_Lambert72_in_file(picture: str | pathlib.Path) tuple[float, float][source]

Find Lambert72 coordinates in the picture file. Returns a tuple (Lambert72X, Lambert72Y). If not found, returns (None, None).

class wolfhece.PyPictures.PictureCollection(filename: str | pathlib.Path = '', ox: float = 0.0, oy: float = 0.0, tx: float = 0.0, ty: float = 0.0, parent=None, is2D=True, idx: str = '', plotted: bool = True, mapviewer=None, need_for_wx: bool = False, bbox: shapely.geometry.Polygon = None, find_minmax: bool = True, shared: bool = False, colors: dict = None)[source]

Bases: wolfhece.PyVertexvectors.Zones

Inheritance diagram of wolfhece.PyPictures.PictureCollection

PictureCollection is a collection of pictures, inheriting from Zones.

_default_size = 200[source]
hide_all_pictures()[source]

Hide all pictures in the collection.

show_all_pictures()[source]

Show all pictures in the collection.

extract_pictures(directory: str | pathlib.Path)[source]

Extract all visible pictures from the collection to a directory.

add_picture(picture: str | pathlib.Path, x: float = None, y: float = None, name: str = '', keyzone: str = None)[source]

Add a picture to the collection at coordinates (x, y).

_find_coordinates_in_file(picture: str | pathlib.Path) tuple[float, float][source]

Find coordinates in the picture file. Returns a tuple (x, y). If not found, returns (None, None).

load_from_url_zipfile(url: str)[source]

Load pictures from a zip file at a given URL. The zip file should contain images with names that can be used as picture names.

load_from_directory_with_excel(excel_file: str | pathlib.Path, sheet_name: str = 'Pictures')[source]

Load pictures from an Excel file. The Excel file should have columns for picture path, x, y, and name.

load_from_directory_georef_pictures(directory: str | pathlib.Path, keyzone: str = None)[source]

Load pictures from a directory. The directory should contain images with names that can be used as picture names.

load_from_directory_with_shapefile(directory: str | pathlib.Path, shapefile: str | pathlib.Path = None, keyzone: str = None)[source]

Load pictures from a directory and associate them with a shapefile.

scale_all_pictures(scale_factor: float)[source]

Scale all vectors in the collection by a scale factor.

wolfhece.PyPictures.main()[source]