You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 8, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,12 +13,12 @@ A PHP class for analysing FIT files created by Garmin GPS devices.
13
13
14
14
Please read this page in its entirety and the [FAQ](https://github.com/adriangibbons/php-fit-file-analysis/wiki/Frequently-Asked-Questions-(FAQ)) first if you have any questions or need support.
15
15
16
-
##What is a FIT file?
16
+
##What is a FIT file?
17
17
FIT or Flexible and Interoperable Data Transfer is a file format used for GPS tracks and routes. It is used by newer Garmin fitness GPS devices, including the Edge and Forerunner series, which are popular with cyclists and runners.
18
18
19
19
Visit the FAQ page within the Wiki for more information.
20
20
21
-
##How do I use phpFITFileAnalysis with my PHP-driven website?
21
+
##How do I use phpFITFileAnalysis with my PHP-driven website?
22
22
23
23
A couple of choices here:
24
24
@@ -55,7 +55,7 @@ There are more **Optional Parameters** that can be supplied. These are described
55
55
56
56
The object will automatically load the FIT file and iterate through its contents. It will store any data it finds in arrays, which are accessible via the public data variable.
57
57
58
-
###Accessing the Data
58
+
###Accessing the Data
59
59
Data read by the class are stored in associative arrays, which are accessible via the public data variable:
60
60
```php
61
61
$pFFA->data_mesgs
@@ -113,7 +113,7 @@ In addition, public functions provide a short-hand way to access commonly used e
113
113
- product()
114
114
- sport()
115
115
116
-
###Optional Parameters
116
+
###Optional Parameters
117
117
There are five optional parameters that can be passed as an associative array when the phpFITFileAnalysis object is instantiated. These are:
118
118
119
119
- fix_data
@@ -134,7 +134,7 @@ $options = [
134
134
$pFFA = new adriangibbons\phpFITFileAnalysis('my_fit_file.fit', $options);
135
135
```
136
136
The optional parameters are described in more detail below.
137
-
####"Fix" the Data
137
+
####"Fix" the Data
138
138
FIT files have been observed where some data points are missing for one sensor (e.g. cadence/foot pod), where information has been collected for other sensors (e.g. heart rate) at the same instant. The cause is unknown and typically only a relatively small number of data points are missing. Fixing the issue is probably unnecessary, as each datum is indexed using a timestamp. However, it may be important for your project to have the exact same number of data points for each type of data.
Some of Garmin's Fitness devices offer the choice of Smart Recording or Every Second Recording.
215
215
216
216
Smart Recording records key points where the fitness device changes direction, speed, heart rate or elevation. This recording type records less track points and will potentially have gaps between timestamps of greater than one second.
@@ -225,7 +225,7 @@ If the ```fix_data``` option is not specified in conjunction with ```data_every_
225
225
226
226
*Note that you may experience degraded performance using the ```fix_data``` option. Improving the performance will be explored - it is likely the ```interpolateMissingData()``` function is sub-optimal.*
227
227
228
-
####Set Units
228
+
####Set Units
229
229
By default, **metric** units (identified in the table below) are assumed.
$options = ['units' => 'metric']; // explicit but not necessary, same as default
267
267
```
268
-
####Pace
268
+
####Pace
269
269
If required by the user, pace can be provided instead of speed. Depending on the units requested, pace will either be in minutes per kilometre (min/km) for metric units; or minutes per mile (min/mi) for statute.
Note that if 'raw' units are requested then this parameter has no effect on the speed data, as it is left untouched from what was read-in from the file.
284
284
285
-
####Timestamps
285
+
####Timestamps
286
286
Unix time is the number of seconds since **UTC 00:00:00 Jan 01 1970**, however the FIT standard specifies that timestamps (i.e. fields of type date_time and local_date_time) represent seconds since **UTC 00:00:00 Dec 31 1989**.
287
287
288
288
The difference (in seconds) between FIT and Unix timestamps is 631,065,600:
@@ -294,7 +294,7 @@ echo 'The difference (in seconds) between FIT and Unix timestamps is '. number_f
294
294
```
295
295
By default, fields of type date_time and local_date_time read from FIT files will have this delta added to them so that they can be treated as Unix time. If the FIT timestamp is required, the 'garmin_timestamps' option can be set to true.
296
296
297
-
##Analysis
297
+
##Analysis
298
298
The following functions return arrays of data that could be used to create tables/charts:
@@ -347,7 +347,7 @@ Note that ```$pFFA->criticalPower``` and some power metrics (Normalised Power, V
347
347
348
348
A demo of power analysis is available [here](http://adriangibbons.com/php-fit-file-analysis/demo/power-analysis.php).
349
349
350
-
##Other methods
350
+
##Other methods
351
351
Returns array of booleans using timestamp as key. true == timer paused (e.g. autopause):
352
352
```php
353
353
array isPaused()
@@ -366,7 +366,7 @@ Returns array of gear change information (if present, e.g. using Shimano D-Fly W
366
366
array gearChanges($bIgnoreTimerPaused = true)
367
367
```
368
368
369
-
##Acknowledgement
369
+
##Acknowledgement
370
370
This class has been created using information available in a Software Development Kit (SDK) made available by ANT ([thisisant.com](http://www.thisisant.com/resources/fit)).
371
371
372
372
As a minimum, I'd recommend reading the three PDFs included in the SDK:
0 commit comments