Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

walking-tracker

Classifies GPS tracks from OwnTracks (iPhone) into walking segments and builds a master GeoJSON file you can load into any map viewer.

How it works

  1. OwnTracks exports GPX files to iCloud Drive.
  2. iCloud Drive syncs to WSL at a path like /mnt/c/Users/YourName/iCloud Drive/GPX-Tracks/.
  3. pipeline.py scans that folder, runs each new file through the classifier, and appends walking segments to walks.geojson.

Classification heuristics

Each track is filtered and split before classification:

  • Accuracy filter — points with GPS accuracy worse than 25 m are dropped.
  • Gap splitting — a pause of more than 5 minutes starts a new segment.
  • Speed splitting — 3+ consecutive intervals above 7 km/h are carved out as their own (non-walking) segment.

A segment is labelled walking if:

  • ≥ 65% of 5-point rolling windows have an average speed between 0.3 and 7 km/h, and
  • path coherence (straight-line displacement ÷ total path length) is ≥ 0.5.

Setup

pip install gpxpy

Usage

python pipeline.py "/mnt/c/Users/YourName/iCloud Drive/GPX-Tracks"

Run this whenever new GPX files have synced. Already-processed files are recorded in processed.json so re-runs are safe.

Output files

File Description
walks.geojson GeoJSON FeatureCollection of walking LineString features, each with start_time and end_time properties.
processed.json List of GPX filenames already ingested — do not delete this or files will be reprocessed.

Both files are written to whichever directory you run the script from.

Using the classifier directly

from classifier import classify_track

points = [
    {"lat": 43.47, "lon": -80.54, "time": datetime(...), "accuracy": 8.0},
    ...
]
segments = classify_track(points)
for seg in segments:
    if seg.is_walking:
        print(f"Walk: {len(seg.points)} points")

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages