hittekaart_py package¶
The hittekaart_py module provides a Python interface for hittekaart
heatmap generation. Unlike previous modules, this is a binding using
PyO3, and not a subprocess wrapper.
Example¶
from hittekaart_py import (
    Track, HeatmapRenderer, Settings, Storage, generate
)
settings = Settings(threads=3)
tracks = [
    Track.from_file(b"Documents/track.gpx", None),
    Track.from_coordinates([(45.0, 47.0)]),
]
storage = Storage.Sqlite(b"/tmp/tiles.sqlite")
generate(settings, tracks, HeatmapRenderer(), storage)
Input and output¶
- class hittekaart_py.Track¶
- An in-memory representation of a track. - static from_file(path, compression)¶
- Loads a track from the given file. 
 
Renderers¶
- class hittekaart_py.HeatmapRenderer¶
- The renderer that generates a heatmap. 
- class hittekaart_py.MarktileRenderer¶
- The renderer that will only mark visited tiles. 
Tile generation¶
- class hittekaart_py.Settings(min_zoom=1, max_zoom=19, threads=0)¶
- Settings that apply to all renderers. 
- hittekaart_py.generate(settings, items, renderer, storage)¶
- Generates the tiles using the given renderer, and saves them to the given storage. - Parameters:
- settings (Settings) – The settings. 
- renderer (HeatmapRenderer | MarktileRenderer | TilehuntRenderer) – The renderer to use. 
- storage (Storage) – The storage to output to. 
 
 
Errors¶
- exception hittekaart_py.HitteError¶
- Catch-all error for underlying hittekaart errors. See the string description for the error cause.