https://github.com/mooflu/fitdb
Command line tool to import Garmin fit data into sqlite db and query by location and date range
https://github.com/mooflu/fitdb
fit garmin sqlite sqlite3
Last synced: about 2 months ago
JSON representation
Command line tool to import Garmin fit data into sqlite db and query by location and date range
- Host: GitHub
- URL: https://github.com/mooflu/fitdb
- Owner: mooflu
- License: other
- Created: 2024-10-23T00:36:59.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-29T19:39:01.000Z (over 1 year ago)
- Last Synced: 2025-04-06T19:33:55.529Z (about 1 year ago)
- Topics: fit, garmin, sqlite, sqlite3
- Language: C
- Homepage:
- Size: 3.03 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Notes to self
- use [gcexport.py](https://github.com/pe-st/garmin-connect-export) to grab FIT files from Garmin site.
```
python3 gcexport.py --username -f original -u -c all
if some of the original files are gpx, grab them as tcx
python3 gcexport.py --username -f tcx -u -c all
```
- use [gpsbabel](https://github.com/GPSBabel/gpsbabel) to convert non FIT to FIT
```
for x in *.tcx; do ../../gpsbabel/gpsbabel -i gtrnctr -f $x -o garmin_fit -F ${x:r}.fit ; done
```
- build fitdb
- import data
```
./build/src/fitdb -i ../fit_data
```
- query by location and date range
```
./build/src/fitdb --nec 49.789256859574444 -122.98610951567522 --swc 49.7830224018896 -122.9937909886709 -f 2011-01-01 -t 2015-01-01
query:
select distinct(a.garminActivity) from activity a, location l on a.id=l.activityId
where minlat>593934591.9781978 and maxLat<594008971.9555998 and minLng>-1467373083.076114 and maxLng<-1467281439.5336096 and startTime>=662716800 and startTime<=788947200
order by a.garminActivity desc
limit 100;
Results:
https://connect.garmin.com/modern/activity/<...>
...
```