Garmin Training Center for OS X Data File Format

My interest in learning the secrets of the Garmin Training Center for OS X user data file was renewed upon learning that the author of TrailRunner added the ability to import GTC data directly into that app. After a cursory search for clues on the format of the “Training Center.gtc” data file, I managed to find the needed bit of knowledge after digging through one of the forums over at MotionBased. One of the posters - saeedi - suggested it was a sqlite database. After making a copy of the file, I opened it up with sqlite3, tried a “.schema” command and was greeted with the following:

CREATE TABLE ZCDABSTRACTSTEP ( Z_ENT INTEGER, Z_PK INTEGER PRIMARY KEY, Z_OPT INTEGER, ZORDER INTEGER, ZBELONGSTOPLAN INTEGER, ZISCHILDOF INTEGER, ZITERATIONS INTEGER, ZNAME VARCHAR, ZISRESTING INTEGER, ZCOMPLETIONCRITERIA INTEGER, Z5_COMPLETIONCRITERIA INTEGER, ZPERFORMANCEZONE INTEGER, Z12_PERFORMANCEZONE INTEGER );

CREATE TABLE ZCDACTIVITYPROFILE ( Z_ENT INTEGER, Z_PK INTEGER PRIMARY KEY, Z_OPT INTEGER, ZMAXHEARTRATE INTEGER, ZNAME VARCHAR, ZGEARWEIGHT FLOAT, ZACTIVITYTYPE INTEGER, ZDEVICE INTEGER );
CREATE TABLE ZCDCOMPLETIONCRITERIA ( Z_ENT INTEGER, Z_PK INTEGER PRIMARY KEY, Z_OPT INTEGER, ZBELONGSTOLEAFSTEP INTEGER, ZTARGETCALORIES INTEGER, ZTARGETDISTANCE INTEGER, ZLIMIT INTEGER, ZLIMITTYPE INTEGER, ZTARGETTIME INTEGER );

CREATE TABLE ZCDDEVICE ( Z_ENT INTEGER, Z_PK INTEGER PRIMARY KEY, Z_OPT INTEGER, ZID INTEGER, ZMAXSCHEDULEDPLANS INTEGER, ZMAXCOURSETRACKPOINTS INTEGER, ZMAXCOURSEPOINTS INTEGER, ZMAXSCHEDULEDPLANDATES INTEGER, ZPRODUCTNAME VARCHAR, ZMAXCOURSELAPS INTEGER, ZMAXUNSCHEDULEDPLANS INTEGER, ZNAME VARCHAR, ZMAXCOURSES INTEGER, ZPRODUCTID INTEGER, ZSOFTWAREVERSION INTEGER, ZOWNER INTEGER );
…(trimmed)…

It certainly looks like it’s a sqlite database. Just to verify, I tried a few SQL commands:

sqlite> select zproductname from zcddevice ;
ZPRODUCTNAME
--------------------
EDGE305
Forerunner305

sqlite>.output gtc-tree.html
sqlite>select * from zcdtreeitem

While not the prettiest schema, it’s workable. Once I get more time to dissect it a bit, I’ll post some code to extract runs/routes and maybe even take a shot at a widget.


|