fietsboek.hittekaart module¶
Interface to the hittekaart application to generate heatmaps.
- class fietsboek.hittekaart.Mode(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
Enum
Heatmap generation mode.
This enum represents the different types of overlay maps that
hittekaart
can generate.- HEATMAP = 'heatmap'¶
- TILEHUNTER = 'tilehunter'¶
- fietsboek.hittekaart.generate(output, mode, input_files, *, exe_path=None, threads=0)¶
Calls hittekaart with the given arguments.
- Parameters:
output (
Path
) – Output filename. Note that this function always uses the sqlite output mode.mode (
Mode
) – What to generate.input_files (
list
[Path
]) – List of paths to the input files.exe_path (
Optional
[Path
]) – Path to the hittekaart binary. If not given,hittekaart
is searched in the path.threads (
int
) – Number of threads thathittekaart
should use. Defaults to 0, which uses all available cores.
- fietsboek.hittekaart.generate_for(user, dbsession, data_manager, mode, *, exe_path=None, threads=0)¶
Uses
generate()
to generate a heatmap for the given user.This function automatically retrieves the user’s tracks from the database and passes them to
hittekaart
.The output is saved in the user’s data directory using the
data_manager
.- Raises:
ValueError – If the user does not have an ID and thus the map cannot be saved.
- Parameters:
user (
User
) – The user for which to generate the map.dbsession (
Session
) – The database session.data_manager (
DataManager
) – The data manager.mode (
Mode
) – The mode of the heatmap.exe_path (
Optional
[Path
]) – Seegenerate()
.threads (
int
) – Seegenerate()
.