Tools for summarizing and viewing sporty GPX traces
Project description
Hilly
Tools for summarizing and viewing sporty GPX traces
Install
pip install hilly
Dev Install
git clone
cd hilly
poetry install
Features
- Traces are loaded as GeoDataFrames (convenient exploring and editing)
- Rasterize traces to see popular routes/trails.
- Label/Filter Skiing Trace to label/exclude chair-lifts.
- Summary for Skiing day
Usage
Import a trace:
import hilly
df = hilly.io.load_trace("path/to/trace.gpx")
If it is a ski/snowboarding trace, apply filters to identify runs/lifts:
ski_df = hilly.ski.apply_filters(df)
ski_df.labels_str.unique().tolist()
# ['', 'lift-1', 'run-1', 'run-2', 'lift-2', 'run-3', 'lift-3', 'run-4']
The labels_str
column labels points in the trace as belonging to a lift ride or run, otherwise it is empty. The number indicates a count of lift/runs.
From there you can get a summary for the trace (assuming it is over a single day):
summary = hilly.ski.summary(ski_df)
#🏂 Ski Stats ⛷
# runs: 4
# Total Dist(km): 4.815023209198009
# Longest Run(km): 1.409849302232853
# Total time: 0 days 00:17:32
# Total lift time: 0 days 00:36:55.990000
# Time Ratio: 0.4747313841668961
Or, you can view the trace:
# open leaflet map showing points, dropping datetime column for proper JSON
m = ski_df.drop(columns=["time"]).explore("labels", cmap="coolwarm_r")
m.show_in_browser()
or rasterize the trace to get a density map:
arr, bounds = hilly.utils.rasterize(ski_df, runs_only=True, res=1)
m = hilly.io.map_raster(arr, bounds)
m.show_in_browser()
Collecting Traces
There are many apps available for collecting traces. I use OpenTracks and follow the Export instructions from the settings menu.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
hilly-0.1.1.tar.gz
(6.9 kB
view hashes)
Built Distribution
hilly-0.1.1-py3-none-any.whl
(8.0 kB
view hashes)