gooby 1.2.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (257) hide show
  1. data/README +133 -341
  2. data/config/ballantyne.yaml +11 -0
  3. data/config/big_sur_marathon.yaml +11 -0
  4. data/config/crowders_mtn_hike.yaml +11 -0
  5. data/config/davidson1.yaml +16 -0
  6. data/config/gooby_config.yaml +28 -135
  7. data/cucumber.yml +1 -0
  8. data/features/build_gem.feature +88 -0
  9. data/features/gooby.feature +300 -0
  10. data/features/install.feature +78 -0
  11. data/features/steps/gooby_steps.rb +245 -0
  12. data/features/support/env.rb +4 -0
  13. data/lib/gooby.rb +24 -30
  14. data/lib/gooby_activity.rb +63 -0
  15. data/lib/gooby_base_object.rb +46 -0
  16. data/lib/gooby_base_sax_parser.rb +95 -0
  17. data/lib/gooby_configuration.rb +33 -115
  18. data/lib/gooby_counter_hash.rb +28 -87
  19. data/lib/gooby_dttm.rb +88 -66
  20. data/lib/gooby_environment.rb +48 -0
  21. data/lib/gooby_garmin_tcx_parser.rb +92 -0
  22. data/lib/gooby_google_kml_generator.rb +168 -0
  23. data/lib/gooby_google_map_generator.rb +284 -349
  24. data/lib/gooby_gpx_parser.rb +97 -0
  25. data/lib/gooby_help_producer.rb +40 -0
  26. data/lib/gooby_introspection.rb +25 -0
  27. data/lib/gooby_io.rb +30 -0
  28. data/lib/gooby_lap.rb +27 -18
  29. data/lib/gooby_process.rb +281 -0
  30. data/lib/gooby_sax_path_parser.rb +43 -0
  31. data/lib/gooby_tcx_extractor.rb +71 -0
  32. data/lib/gooby_track_log_parser.rb +114 -0
  33. data/lib/gooby_trackpoint.rb +276 -0
  34. data/lib/gooby_xml_object.rb +40 -0
  35. data/{img/gicons → out/images}/blank.png +0 -0
  36. data/{img/gicons → out/images}/dd-end.png +0 -0
  37. data/{img/gicons → out/images}/dd-start.png +0 -0
  38. data/{img/gicons → out/images}/marker.png +0 -0
  39. data/{img/gicons → out/images}/marker0.png +0 -0
  40. data/{img/gicons → out/images}/marker00.png +0 -0
  41. data/{img/gicons → out/images}/marker01.png +0 -0
  42. data/{img/gicons → out/images}/marker02.png +0 -0
  43. data/{img/gicons → out/images}/marker03.png +0 -0
  44. data/{img/gicons → out/images}/marker04.png +0 -0
  45. data/{img/gicons → out/images}/marker05.png +0 -0
  46. data/{img/gicons → out/images}/marker06.png +0 -0
  47. data/{img/gicons → out/images}/marker07.png +0 -0
  48. data/{img/gicons → out/images}/marker08.png +0 -0
  49. data/{img/gicons → out/images}/marker09.png +0 -0
  50. data/{img/gicons → out/images}/marker1.png +0 -0
  51. data/{img/gicons → out/images}/marker10.png +0 -0
  52. data/{img/gicons → out/images}/marker11.png +0 -0
  53. data/{img/gicons → out/images}/marker12.png +0 -0
  54. data/{img/gicons → out/images}/marker13.png +0 -0
  55. data/{img/gicons → out/images}/marker14.png +0 -0
  56. data/{img/gicons → out/images}/marker15.png +0 -0
  57. data/{img/gicons → out/images}/marker16.png +0 -0
  58. data/{img/gicons → out/images}/marker17.png +0 -0
  59. data/{img/gicons → out/images}/marker18.png +0 -0
  60. data/{img/gicons → out/images}/marker19.png +0 -0
  61. data/{img/gicons → out/images}/marker2.png +0 -0
  62. data/{img/gicons → out/images}/marker20.png +0 -0
  63. data/{img/gicons → out/images}/marker21.png +0 -0
  64. data/{img/gicons → out/images}/marker22.png +0 -0
  65. data/{img/gicons → out/images}/marker23.png +0 -0
  66. data/{img/gicons → out/images}/marker24.png +0 -0
  67. data/{img/gicons → out/images}/marker25.png +0 -0
  68. data/{img/gicons → out/images}/marker26.png +0 -0
  69. data/{img/gicons → out/images}/marker27.png +0 -0
  70. data/{img/gicons → out/images}/marker28.png +0 -0
  71. data/{img/gicons → out/images}/marker29.png +0 -0
  72. data/{img/gicons → out/images}/marker3.png +0 -0
  73. data/{img/gicons → out/images}/marker30.png +0 -0
  74. data/{img/gicons → out/images}/marker31.png +0 -0
  75. data/{img/gicons → out/images}/marker32.png +0 -0
  76. data/{img/gicons → out/images}/marker33.png +0 -0
  77. data/{img/gicons → out/images}/marker34.png +0 -0
  78. data/{img/gicons → out/images}/marker35.png +0 -0
  79. data/{img/gicons → out/images}/marker36.png +0 -0
  80. data/{img/gicons → out/images}/marker37.png +0 -0
  81. data/{img/gicons → out/images}/marker38.png +0 -0
  82. data/{img/gicons → out/images}/marker39.png +0 -0
  83. data/{img/gicons → out/images}/marker4.png +0 -0
  84. data/{img/gicons → out/images}/marker40.png +0 -0
  85. data/{img/gicons → out/images}/marker41.png +0 -0
  86. data/{img/gicons → out/images}/marker42.png +0 -0
  87. data/{img/gicons → out/images}/marker43.png +0 -0
  88. data/{img/gicons → out/images}/marker44.png +0 -0
  89. data/{img/gicons → out/images}/marker45.png +0 -0
  90. data/{img/gicons → out/images}/marker46.png +0 -0
  91. data/{img/gicons → out/images}/marker47.png +0 -0
  92. data/{img/gicons → out/images}/marker48.png +0 -0
  93. data/{img/gicons → out/images}/marker49.png +0 -0
  94. data/{img/gicons → out/images}/marker5.png +0 -0
  95. data/{img/gicons → out/images}/marker50.png +0 -0
  96. data/{img/gicons → out/images}/marker51.png +0 -0
  97. data/{img/gicons → out/images}/marker52.png +0 -0
  98. data/{img/gicons → out/images}/marker53.png +0 -0
  99. data/{img/gicons → out/images}/marker54.png +0 -0
  100. data/{img/gicons → out/images}/marker55.png +0 -0
  101. data/{img/gicons → out/images}/marker56.png +0 -0
  102. data/{img/gicons → out/images}/marker57.png +0 -0
  103. data/{img/gicons → out/images}/marker58.png +0 -0
  104. data/{img/gicons → out/images}/marker59.png +0 -0
  105. data/{img/gicons → out/images}/marker6.png +0 -0
  106. data/{img/gicons → out/images}/marker60.png +0 -0
  107. data/{img/gicons → out/images}/marker61.png +0 -0
  108. data/{img/gicons → out/images}/marker62.png +0 -0
  109. data/{img/gicons → out/images}/marker63.png +0 -0
  110. data/{img/gicons → out/images}/marker64.png +0 -0
  111. data/{img/gicons → out/images}/marker65.png +0 -0
  112. data/{img/gicons → out/images}/marker66.png +0 -0
  113. data/{img/gicons → out/images}/marker67.png +0 -0
  114. data/{img/gicons → out/images}/marker68.png +0 -0
  115. data/{img/gicons → out/images}/marker69.png +0 -0
  116. data/{img/gicons → out/images}/marker7.png +0 -0
  117. data/{img/gicons → out/images}/marker70.png +0 -0
  118. data/{img/gicons → out/images}/marker71.png +0 -0
  119. data/{img/gicons → out/images}/marker72.png +0 -0
  120. data/{img/gicons → out/images}/marker73.png +0 -0
  121. data/{img/gicons → out/images}/marker74.png +0 -0
  122. data/{img/gicons → out/images}/marker75.png +0 -0
  123. data/{img/gicons → out/images}/marker76.png +0 -0
  124. data/{img/gicons → out/images}/marker77.png +0 -0
  125. data/{img/gicons → out/images}/marker78.png +0 -0
  126. data/{img/gicons → out/images}/marker79.png +0 -0
  127. data/{img/gicons → out/images}/marker8.png +0 -0
  128. data/{img/gicons → out/images}/marker80.png +0 -0
  129. data/{img/gicons → out/images}/marker81.png +0 -0
  130. data/{img/gicons → out/images}/marker82.png +0 -0
  131. data/{img/gicons → out/images}/marker83.png +0 -0
  132. data/{img/gicons → out/images}/marker84.png +0 -0
  133. data/{img/gicons → out/images}/marker85.png +0 -0
  134. data/{img/gicons → out/images}/marker86.png +0 -0
  135. data/{img/gicons → out/images}/marker87.png +0 -0
  136. data/{img/gicons → out/images}/marker88.png +0 -0
  137. data/{img/gicons → out/images}/marker89.png +0 -0
  138. data/{img/gicons → out/images}/marker9.png +0 -0
  139. data/{img/gicons → out/images}/marker90.png +0 -0
  140. data/{img/gicons → out/images}/marker91.png +0 -0
  141. data/{img/gicons → out/images}/marker92.png +0 -0
  142. data/{img/gicons → out/images}/marker93.png +0 -0
  143. data/{img/gicons → out/images}/marker94.png +0 -0
  144. data/{img/gicons → out/images}/marker95.png +0 -0
  145. data/{img/gicons → out/images}/marker96.png +0 -0
  146. data/{img/gicons → out/images}/marker97.png +0 -0
  147. data/{img/gicons → out/images}/marker98.png +0 -0
  148. data/{img/gicons → out/images}/marker99.png +0 -0
  149. data/{img/gicons → out/images}/markerA.png +0 -0
  150. data/{img/gicons → out/images}/markerB.png +0 -0
  151. data/{img/gicons → out/images}/markerC.png +0 -0
  152. data/{img/gicons → out/images}/markerD.png +0 -0
  153. data/{img/gicons → out/images}/markerE.png +0 -0
  154. data/{img/gicons → out/images}/markerF.png +0 -0
  155. data/{img/gicons → out/images}/markerG.png +0 -0
  156. data/{img/gicons → out/images}/markerH.png +0 -0
  157. data/{img/gicons → out/images}/markerI.png +0 -0
  158. data/{img/gicons → out/images}/markerJ.png +0 -0
  159. data/{img/gicons → out/images}/mm_20_red.png +0 -0
  160. data/{img/gicons → out/images}/mm_20_shadow.png +0 -0
  161. data/{img/gicons → out/images}/shadow50.png +0 -0
  162. data/rakefile.rb +79 -0
  163. data/samples.sh +21 -0
  164. data/samples/2008_04_27_13_49_50_tcx.csv +2449 -0
  165. data/samples/2008_04_27_13_49_50_tcx.xml +24560 -0
  166. data/samples/2009_01_01_14_45_00_tcx.xml +10630 -0
  167. data/samples/ballantyne.csv +27 -0
  168. data/samples/ballantyne.gpx +117 -0
  169. data/samples/ballantyne.kml +91 -0
  170. data/samples/big_sur_marathon.html +2766 -0
  171. data/samples/big_sur_marathon.kml +685 -0
  172. data/samples/build_gem_test_results.txt +6 -0
  173. data/samples/crowders_mtn_hike.csv +1065 -0
  174. data/samples/crowders_mtn_hike.html +1283 -0
  175. data/samples/crowders_mtn_hike.log +1 -0
  176. data/samples/cucumber_test_results.txt +302 -0
  177. data/samples/davidson1.csv +1 -0
  178. data/samples/davidson1.html +75 -0
  179. data/samples/davidson_1_point_tcx.csv +0 -0
  180. data/samples/doc.kml +49 -0
  181. data/samples/gps_track_log_asheville_mt_pisgah.txt +1 -0
  182. data/samples/gps_track_logs.txt +1 -0
  183. data/samples/install_test_results.txt +81 -0
  184. data/samples/mt_pisgah.txt +1 -0
  185. data/samples/rspec_test_results.txt +5 -0
  186. data/setup.rb +66 -0
  187. data/spec/gooby_base_object_spec.rb +116 -0
  188. data/spec/gooby_counter_hash_spec.rb +34 -0
  189. data/spec/gooby_dttm_spec.rb +40 -0
  190. data/spec/gooby_spec_helper.rb +9 -0
  191. data/spec/gooby_xml_object_spec.rb +32 -0
  192. metadata +225 -226
  193. data/bin/code_scan.rb +0 -16
  194. data/bin/gooby_been_there.rb +0 -33
  195. data/bin/gooby_config.rb +0 -24
  196. data/bin/gooby_csv_validation.rb +0 -50
  197. data/bin/gooby_first_trackpoints_as_poi.rb +0 -31
  198. data/bin/gooby_gen_gmap.rb +0 -20
  199. data/bin/gooby_parser.rb +0 -21
  200. data/bin/gooby_splitter.rb +0 -21
  201. data/bin/gooby_version.rb +0 -20
  202. data/bin/run_all.sh +0 -33
  203. data/bin/run_been_there.sh +0 -19
  204. data/bin/run_config.sh +0 -12
  205. data/bin/run_csv_validation.sh +0 -15
  206. data/bin/run_db_gen.sh +0 -11
  207. data/bin/run_db_load.sh +0 -11
  208. data/bin/run_first_trackpoints_as_poi.sh +0 -16
  209. data/bin/run_gen_gmaps.sh +0 -21
  210. data/bin/run_parse_full.sh +0 -45
  211. data/bin/run_parse_samples.sh +0 -21
  212. data/bin/run_split.sh +0 -24
  213. data/bin/run_version.sh +0 -12
  214. data/data/20050305_corporate_cup_hm.csv +0 -251
  215. data/data/20050305_corporate_cup_hm.xml +0 -2208
  216. data/data/20050430_nashville_marathon.xml +0 -10043
  217. data/data/20050430_nashville_marathon_km.csv +0 -1208
  218. data/data/20060115_phoenix_marathon.csv +0 -1280
  219. data/data/20060115_phoenix_marathon.xml +0 -10620
  220. data/data/20070101_davidson_11m.csv +0 -251
  221. data/data/20070101_davidson_11m.xml +0 -2020
  222. data/data/20070505_davidson_5k.xml +0 -2875
  223. data/data/20070505_davidson_5k_km.csv +0 -286
  224. data/data/hrm1.csv +0 -5
  225. data/img/gicons/readme.txt +0 -14
  226. data/lib/gooby_code_scanner.rb +0 -288
  227. data/lib/gooby_command.rb +0 -210
  228. data/lib/gooby_course.rb +0 -117
  229. data/lib/gooby_csv_point.rb +0 -71
  230. data/lib/gooby_csv_reader.rb +0 -71
  231. data/lib/gooby_csv_run.rb +0 -28
  232. data/lib/gooby_delim_line.rb +0 -42
  233. data/lib/gooby_duration.rb +0 -86
  234. data/lib/gooby_forerunner_xml_parser.rb +0 -191
  235. data/lib/gooby_forerunner_xml_splitter.rb +0 -115
  236. data/lib/gooby_history.rb +0 -41
  237. data/lib/gooby_kernel.rb +0 -163
  238. data/lib/gooby_line.rb +0 -80
  239. data/lib/gooby_object.rb +0 -22
  240. data/lib/gooby_point.rb +0 -172
  241. data/lib/gooby_run.rb +0 -213
  242. data/lib/gooby_simple_xml_parser.rb +0 -50
  243. data/lib/gooby_test_helper.rb +0 -23
  244. data/lib/gooby_track.rb +0 -47
  245. data/lib/gooby_track_point.rb +0 -229
  246. data/lib/gooby_training_center_xml_parser.rb +0 -224
  247. data/lib/gooby_training_center_xml_splitter.rb +0 -116
  248. data/lib/split_code.sh +0 -29
  249. data/samples/20050305_corporate_cup_hm.html +0 -450
  250. data/samples/20050430_nashville_marathon.html +0 -1668
  251. data/samples/20060115_phoenix_marathon.html +0 -1596
  252. data/samples/20070101_davidson_11m.html +0 -432
  253. data/samples/20070505_davidson_5k.html +0 -413
  254. data/samples/been_there.txt +0 -92
  255. data/samples/hrm1.html +0 -87
  256. data/sql/gooby.ddl +0 -60
  257. data/sql/gooby_load.dml +0 -62
data/README CHANGED
@@ -1,418 +1,210 @@
1
1
  = Gooby = Google APIs + Ruby
2
2
 
3
- Version: 1.2.0 - 2007/07/22
3
+ Gooby is a set of Ruby code to assist you in creating Google Maps, and
4
+ Google Earth maps, from data exported from your Garmin GPS devices and
5
+ your desktop software such as Garmin Training Center and/or MacGpsPro.
6
+ Gooby will also process gpx data from the iPhone "MotionX GPS" application.
4
7
 
5
- Gooby = Google APIs + Ruby. Release 1.2.0 generates Google maps from GPS data
6
- exported by your Garmin Forerunner GPS unit, or manually edited CSV file.
7
- Please see the README file. Feedback is requested.
8
+ It will parse the exported Garmin xml/tcx/txt data, or MotionX gpx data,
9
+ into csv files in a "standard gooby format". You then use Gooby to generate
10
+ maps from specific csv files per yaml configuration files.
8
11
 
9
- Sample maps at:
10
- http://www.joakim-systems.com:8219/gmap/
11
- http://www.joakim-systems.com:8219/gmap/ccc_half_2005
12
- http://www.joakim-systems.com:8219/gmap/nashville_marathon_2005
13
- http://www.joakim-systems.com:8219/gmap/phoenix_marathon_2006
12
+ The typical uses of Gooby are to create maps of your running, cycling, or
13
+ hiking events, though Gooby is suitable for mapping any outdoor activity.
14
14
 
15
- This README document is available at:
16
- http://www.joakim-systems.com:8219/gooby/readme
17
-
18
- ---
19
-
20
- This gem contains 'Gooby', a set of Ruby code to assist you with using and
21
- producing content for the various Google APIs. The initial focus of Gooby is
22
- on the Google Maps API, version 2.0.
23
-
24
- Google Maps can be produced using Gooby from your data in CSV format,
25
- as created in one of the following three ways.
26
- 1) From exported and parsed Garmin ForerunnerLogbook XML files.
27
- 2) From exported and parsed Garmin TrainingCenter TCX(XML) files.
28
- 3) From your own manually edited Global Positioning System (GPS) data.
29
- See any of the 'data/*.csv' files in the distribution for an example
30
- of the CSV format.
31
-
32
- Google maps are applicable really to any outdoor activity for which GPS data
33
- can be obtained. The focus of Gooby is on running, because the author is a
34
- marathon runner, and the Garmin Forerunner (I use models 201, 205, and 305)
35
- is primarily intended for running. Other activities, such as cycling, hiking,
36
- walking, driving, and even golfing are also well suited for Gooby. Please let
37
- me know how you use Gooby! Feedback is requested.
38
-
39
- All Gooby functionality is intended to be invoked from a command line. Web
40
- and Rails integration may be done in a later release.
15
+ All Gooby functionality is intended to be invoked from a command line.
41
16
 
42
17
  = General
43
18
 
44
19
  Author:: Chris Joakim <chris@joakim-systems.com>
45
20
  Requires:: Ruby 1.8.4 or later
46
- License:: Copyright 2007 by Chris Joakim.
21
+ License:: Copyright 2009 by Chris Joakim.
47
22
  GNU General Public License (GPL) license.
48
23
  See http://www.gnu.org/copyleft/gpl.html
49
-
24
+
50
25
  == License
51
26
 
52
27
  Gooby is available under GNU General Public License (GPL) license.
53
28
 
54
- == Download
55
-
56
- The latest version of gooby can be found at
57
- * http://rubyforge.org/projects/gooby/
58
-
59
- == Installation
60
-
61
- Gooby is packaged and installed as a ruby 'gem'. Download the latest gem to
62
- your computer, then run the following command from your download directory.
63
-
64
- gem install gooby-1.2.0.gem
65
-
66
- == Online Resources
67
-
68
- * The Gooby home page http://rubyforge.org/projects/gooby/.
69
- RubyForge provides CVS hosting for the project.
70
-
71
- Sample Gooby-generated Google Maps are at www.joakim-systems.com, below:
72
-
73
- http://www.joakim-systems.com:8219/gmap/
74
- http://www.joakim-systems.com:8219/gmap/ccc_half_2005
75
- http://www.joakim-systems.com:8219/gmap/nashville_marathon_2005
76
- http://www.joakim-systems.com:8219/gmap/phoenix_marathon_2006
77
- http://www.joakim-systems.com:8219/gmap/gps_data_capture
78
29
 
30
+ == Download
79
31
 
80
- == This Release - 1.2.0
32
+ Gooby is packaged and installed as a ruby 'gem'. Download file 'gooby-2.0.0.gem'
33
+ from http://rubyforge.org/projects/gooby/.
81
34
 
82
- * Added support for the Garmin 305 Heartbeat monitor.
83
- - Heartbeat values are captured in the XML parsing process.
84
- - CSV file format expanded to include heartbeat.
85
- - Database DDL modified to add the heartbeat column.
86
- - Generated Google Maps now have heartbeat in the popup windows.
87
- - Legacy Garmin 201 and Garmin 205 CSV files and Google Maps simply
88
- omit the heartbeat information.
89
- - Heartbeat is displayed, if data is present, in the new Gooby 1.1.0
90
- "been_there" reports. This may be interesting for hill-climbers
91
- and interval-trainers.
92
35
 
93
- * Added support for the English (miles) or Metric (kilometers) systems.
94
- - Either 'mi' or 'km' is specified in the XML parsing process.
95
- - mi or km unit-of-measure is retained in the CSV files.
96
- - Generated Google Maps now generate markers at either integer
97
- miles or kilometers, depending on the input CSV file.
98
- - Generated Google Map popup windows display the unit-of-measure.
36
+ == Installation
99
37
 
100
- Special thanks to Karl Otto Emanuelsson for his suggestion to add
101
- metric system support.
38
+ 1. Ensure that you have the necessary prerequisites installed on your computer. These
39
+ include ruby itself, the rubygems package management system, and the libxml-ruby 0.9.7
40
+ and fastercsv 1.4.0 gems.
102
41
 
103
- * Refactored the codebase into individual class and module files, rather
104
- than the previous monolithic gooby.rb file.
42
+ You will also need desktop software, such as Garmin Training Center and/or MacGpsPro,
43
+ which reads data from your GPS device, and enables it to be exported to files which
44
+ Gooby can process. Garmin Training Center is a free download from Garmin.com.
105
45
 
46
+ 2. Set the required GOOBY_HOME environment variable on your computer. This variable
47
+ names the directory on your computer where you will store your Gooby-related files,
48
+ and where Gooby will generate content to. Suggested values are 'C:\gooby' on Windows,
49
+ and '~/gooby' on unix-based systems.
106
50
 
107
- == Previous Release - 1.1.0
51
+ 3. From your downloads directory, run the following commands:
52
+ gem unpack gooby-2.0.0.gem
53
+ sudo gem install gooby-2.0.0.gem
108
54
 
109
- * Greatly simplify usage and command-line argument handling.
110
- See the shell scripts and ruby files in the /bin directory for examples.
55
+ 4. Step 3 creates directory 'gooby-2.0.0' within your downloads directory. Navigate
56
+ into this directory, then run the following command.
57
+ ruby setup.rb
111
58
 
112
- Special thanks to Davis Kitchel for his several suggestions that resulted
113
- in the following enhancements:
59
+ This will create subdirectories within your GOOBY_HOME, and will populate the /config
60
+ and /samples directories with several files.
114
61
 
115
- * Gooby is a Garmin XML parser! The 'marketing' focus on Gooby prior to now
116
- has been on Google Map generation. However, some users simply use it as
117
- a Garmin XML to CSV parser, then use the parsed data for their own various
118
- needs without creating a Google map. This release recognizes that simple
119
- parsing of Garmin data is a significant and "core" use of Gooby.
120
62
 
121
- * Reformatted the parsed CSV files and added more fields to each output
122
- line, including a unique identifier (primary key), run_id, and lap-specific
123
- info such as lap number, lap distance, and lap elapsed time.
63
+ == Usage
124
64
 
125
- * Renamed and enhanced yaml file 'gooby_config.yaml'. Previously, this had
126
- been Google-map biased. This release allows you to define your own
127
- "points of interest" (poi) in the yaml file. Furthermore, you can define
128
- "courses" or "subcourses" which consist of a given series of points-of-
129
- interest. See 'gooby_config.yaml' for examples.
65
+ All Gooby functionality is invoked from a command line in your GOOBY_HOME directory.
66
+ The rake program is used to execute all Gooby functions.
130
67
 
131
- * Added proximity-based "been_there" reporting logic (method 'been_there' of
132
- class GoobyCommand). This functionality allows you to scan your CVS data
133
- file(s) where you have been on user-specified "courses", within a given
134
- proximity. Your courses are defined in the yaml file (see the above item).
135
- Proximity is specified in "degrees difference" between the course point
136
- definition coordinates, and the actual observed GPS coordinates. Degrees
137
- difference is defined as the absolute value of lat1 - lat2, plus the
138
- absolute value of lng1 - lng2.
68
+ I encourage the reader to read the cucumber test file, 'features/gooby.feature' to become
69
+ familiar with how to use Gooby. Cucumber is a ruby testing tool that allows you to specify
70
+ tests and requirements in English, then have ruby translate and execute the English text.
139
71
 
140
- For an example report, see file 'been_there.txt' in the /samples directory.
72
+ 1. Run command 'rake' from your GOOBY_HOME to see the list of Gooby commands available to you.
73
+ The list you see will look like the following:
141
74
 
142
- This functionality essentially lets you retroactively "click the Lap button"
143
- on your Garmin GPS receiver and examine split-times between given points.
144
- Typical usage is to examine "hill climb", "time trial", or "speedwork"
145
- zones within your runs or rides.
75
+ rake # Default Task; Display Gooby usage instructions.
76
+ rake gooby:help # Display Gooby usage instructions.
77
+ rake gooby:extract_activities_from_tcx # Extract individual Activity xml files from a Garmin tcx file
78
+ rake gooby:parse_activity_xml_to_csv # Parse an extracted Activity xml file to a corresponding csv file.
79
+ rake gooby:parse_track_log_to_csv # Parse a GPS Track Log file a corresponding csv file.
80
+ rake gooby:parse_gpx_to_csv # Parse a GPX file a corresponding csv file.
81
+ rake gooby:generate_google_map # Generate a Google Map from a csv file.
82
+ rake gooby:generate_google_earth_map # Generate a Google Earth kml file from a csv file.
146
83
 
147
- * Optional support for loading your GPS data into a MySQL database. See the
148
- generate and load scripts in the /sql directory.
149
-
150
- Note that Gooby data does NOT need to be loaded into a database; the CSV
151
- format is preferred. However, users may find it useful to store this data
152
- in a database for their required processing.
153
-
154
- === Road Map / TODO List
155
-
156
- * IE or Google Bug - The Google Map v2 JavaScript has not run properly in
157
- Internet Explorer at times. Script error after loading the map background,
158
- but before the map route is drawn.
159
-
160
- Note: The Google Map v2 code seems to have been significantly improved for
161
- Windows Explorer during Q2 2007, as the Gooby-generated Google Maps now
162
- display properly in IE.
163
-
164
- * Add Rails support for realtime dynamic map/content generation.
165
-
166
- * Parse cadence information from Garmin export file for cyclists.
167
- Note: Please provide me a sample file.
168
-
169
- * Add other Google APIs (earth, search, sitemaps, froogle, etc).
170
-
171
- == Support
172
-
173
- Please see http://rubyforge.org/projects/gooby/ to submit a request or report
174
- a bug, on the Tracker page.
175
-
176
- ----
177
-
178
- = Usage
179
-
180
- See the 'run_xxx.sh' shell scripts and corresponding ruby files in the /bin directory
181
- for actual working examples used during Gooby development and testing.
182
-
183
- The following in-line text shows both the shell and ruby code.
184
-
185
- Function 1 - Gooby Version Information
186
- -------------------------------------------
187
- shell:
188
-
189
- ruby /devtools/workspace/RF_Gooby/bin/gooby_version.rb
84
+ 2. Run command 'rake', or 'rake gooby:help' to display the "help content" for Gooby;
85
+ it contains specific examples of each command, and a description of the directory structure.
86
+
87
+ 3. The typical usage sequence is as follows.
88
+
89
+ Part 1 - outside of the realm of Gooby:
90
+ a. Do some outdoor event, with your Garmin GPS device recording your movements.
91
+ Or with your MotionX application on your iPhone. Or with another device that
92
+ can emit data in gpx format.
93
+ b. Connect your Garmin device to your computer, typically via a USB port.
94
+ c. Use your desktop software, such as Garmin Training Center, to import the GPS
95
+ data from your GPS device.
96
+ d. Use your desktop software to export its data to a file in your 'GOOBY_HOME/data' directory.
97
+ In Garmin Training Center, this is done with the File -> Export... menu.
190
98
 
191
- ruby:
192
-
193
- require 'rubygems'
194
- require 'gooby'
195
- include REXML
196
-
197
- config_filename = '/devtools/workspace/RF_Gooby/config/gooby_config.yaml'
198
-
199
- gooby = Gooby::GoobyCommand.new(config_filename)
200
- gooby.display_version
201
-
202
-
203
- Function 2 - Gooby Configuration YAML Contents
204
- ----------------------------------------------
205
- shell:
206
-
207
- ruby /devtools/workspace/RF_Gooby/bin/gooby_config.rb
208
-
209
- ruby:
210
-
211
- require 'rubygems'
212
- require 'gooby'
213
- include REXML
214
-
215
- config_filename = '/devtools/workspace/RF_Gooby/config/gooby_config.yaml'
216
-
217
- gooby = Gooby::GoobyCommand.new(config_filename)
218
- gooby.display_configuration
219
-
220
-
221
- Function 3 - Garmin XML/TCX file splitting:
222
- -------------------------------------------
223
- shell:
224
-
225
- rm /temp/splits/*.*
226
-
227
- ruby /devtools/workspace/RF_Gooby/bin/gooby_splitter.rb garmin201 /devtools/workspace/RF_Gooby/data/raw/forerunner_201_2007.xml /temp/splits
228
- ruby /devtools/workspace/RF_Gooby/bin/gooby_splitter.rb garmin205 /devtools/workspace/RF_Gooby/data/raw/forerunner_205_2007.tcx /temp/splits
229
- ruby /devtools/workspace/RF_Gooby/bin/gooby_splitter.rb garmin305 /devtools/workspace/RF_Gooby/data/raw/forerunner_305_2007.tcx /temp/splits
230
-
231
- ls -al /temp/splits
232
-
233
- ruby:
234
-
235
- require 'rubygems'
236
- require 'gooby'
237
- include REXML
99
+ Part 2 - within the realm of Gooby:
100
+ e. Depending on your GPS device and desktop software, you'll use the following commands
101
+ to parse a data file into the "gooby standard csv format":
102
+ - rake gooby:extract_activities_from_tcx # Garmin 305 & Garmin Training Center
103
+ - rake gooby:parse_activity_xml_to_csv # Garmin 305 & Garmin Training Center
104
+ - rake gooby:parse_track_log_to_csv # Garmin eTrex Venture & MacGpsPro
105
+ - rake gooby:parse_gpx_to_csv # MotionX app on iPhone
238
106
 
239
- config_filename = '/devtools/workspace/RF_Gooby/config/gooby_config.yaml'
107
+ Note that files in "gooby standard csv format" can be used to generate either
108
+ Google Maps or Google Earth Maps... there is no need to recreate the csv file
109
+ depending on what type of map you wish to create.
240
110
 
241
- gooby = Gooby::GoobyCommand.new(config_filename)
242
- gooby.display_version
243
- gooby.split_garmin_export_file(ARGV)
244
-
245
-
246
- Function 4 - Garmin XML/TCX file parsing:
247
- -----------------------------------------
248
- shell:
111
+ f. Manually create and edit a yaml configuration file in the /config directory for the
112
+ specific map you want to generate. For example: config/big_sur_marathon.yaml
113
+ Specify its input csv file, and any other appropriate yaml parameter values.
114
+ This design approach was taken so that you can create a configuration file for
115
+ each map, then essentially not have to modify that file again to regenerate the map.
116
+ Be sure to set the value of 'gmap_key' to your own Google Maps key.
249
117
 
250
- ruby /devtools/workspace/RF_Gooby/bin/gooby_parser.rb garmin201 mi /devtools/workspace/RF_Gooby/data/20060115_phoenix_marathon.xml > /devtools/workspace/RF_Gooby/data/20060115_phoenix_marathon.csv
118
+ g. Run command 'rake gooby:generate_google_map' to generate a Google Map html file.
119
+ View the file in your browser, and optionally deploy it to your web site.
251
120
 
252
- ruby /devtools/workspace/RF_Gooby/bin/gooby_parser.rb garmin205 km /devtools/workspace/RF_Gooby/data/20070505_davidson_5k.xml > /devtools/workspace/RF_Gooby/data/20070505_davidson_5k_km.csv
121
+ h. Run command 'rake gooby:generate_google_earth_map' to generate a Google Earth kml file.
122
+ View the file in your Google Earth software.
253
123
 
254
- ruby:
124
+ i. Example commands, see file samples.sh
255
125
 
256
- require 'rubygems'
257
- require 'gooby'
258
- include REXML
126
+ rake
259
127
 
260
- config_filename = '/devtools/workspace/RF_Gooby/config/gooby_config.yaml'
128
+ rake gooby:extract_activities_from_tcx
261
129
 
262
- gooby = Gooby::GoobyCommand.new(config_filename)
263
- gooby.parse_garmin_xml_file(ARGV)
130
+ rake gooby:parse_activity_xml_to_csv config_file=config/big_sur_marathon.yaml
264
131
 
132
+ rake gooby:parse_track_log_to_csv config_file=config/crowders_mtn_hike.yaml
265
133
 
266
- Function 5 - CSV File Validation
267
- --------------------------------
268
- shell:
134
+ rake gooby:parse_gpx_to_csv config_file=config/ballantyne.yaml
269
135
 
270
- ruby /devtools/workspace/RF_Gooby/bin/gooby_csv_validation.rb
136
+ rake gooby:generate_google_map config_file=config/big_sur_marathon.yaml
137
+ rake gooby:generate_google_map config_file=config/crowders_mtn_hike.yaml
138
+ rake gooby:generate_google_map config_file=config/ballantyne.yaml
271
139
 
272
- ruby:
140
+ rake gooby:generate_google_earth_map config_file=config/big_sur_marathon.yaml
141
+ rake gooby:generate_google_earth_map config_file=config/crowders_mtn_hike.yaml
142
+ rake gooby:generate_google_earth_map config_file=config/ballantyne.yaml
273
143
 
274
- require 'rubygems'
275
- require 'gooby'
276
- include REXML
277
144
 
278
- config_filename = '/devtools/workspace/RF_Gooby/config/gooby_config.yaml'
279
-
280
- full_files = false
281
-
282
- list = Array.new
283
- list << '/devtools/workspace/RF_Gooby/data/hrm1.csv'
284
- list << '/devtools/workspace/RF_Gooby/data/20050305_corporate_cup_hm.csv'
285
- list << '/devtools/workspace/RF_Gooby/data/20050430_nashville_marathon_km.csv'
286
- list << '/devtools/workspace/RF_Gooby/data/20060115_phoenix_marathon.csv'
287
- list << '/devtools/workspace/RF_Gooby/data/20070101_davidson_11m.csv'
288
- list << '/devtools/workspace/RF_Gooby/data/20070505_davidson_5k_km.csv'
289
-
290
- list << '/devtools/workspace/RF_Gooby/data/2007_g201.csv' if full_files
291
- list << '/devtools/workspace/RF_Gooby/data/2007_g205.csv' if full_files
292
- list << '/devtools/workspace/RF_Gooby/data/2007_g305.csv' if full_files
293
-
294
- gooby = Gooby::GoobyCommand.new(config_filename)
295
- @csv_points = gooby.read_csv_files(list)
296
- @csv_col_names = gooby.csv_col_names
297
-
298
- puts "#{@csv_points.size} points read from csv file(s)."
299
- puts "#{@csv_col_names.size} fields per line."
300
-
301
- index = 0
302
- @csv_col_names.each {|col_name|
303
- puts sprintf("-- %s %2s [%s]", col_name.ljust(16), index, @csv_points[-1].tokens[index])
304
- index = index + 1
305
- }
306
-
307
- @csv_points.each {|csv_point|
308
- puts csv_point.rawdata if csv_point.token_count != 15
309
- }
310
-
311
-
312
- Function 6 - "been_there":
313
- --------------------------
314
- shell:
315
-
316
- ruby /devtools/workspace/RF_Gooby/bin/gooby_been_there.rb > /devtools/workspace/RF_Gooby/samples/been_there.txt
317
-
318
- ruby /devtools/workspace/RF_Gooby/bin/gooby_been_there.rb
319
-
320
- ruby:
321
-
322
- require 'rubygems'
323
- require 'gooby'
324
- include REXML
325
-
326
- config_filename = '/devtools/workspace/RF_Gooby/config/gooby_config.yaml'
327
-
328
- gooby = Gooby::GoobyCommand.new(config_filename)
145
+ == Online Resources
329
146
 
330
- # first read the csv file(s) parsed from your Garmin export tcx/xml files.
331
- list = Array.new
332
- list << '/devtools/workspace/RF_Gooby/data/20070101_davidson_11m.csv'
333
- list << '/devtools/workspace/RF_Gooby/data/hrm1.csv'
334
- gooby.read_csv_files(list)
147
+ * Gooby may be downloaded from http://rubyforge.org/projects/gooby/.
335
148
 
336
- # first arg to 'been_there' is the course number, second arg is the 'proximity' specified as
337
- # 'degrees difference'. Degrees difference is defined as the absolute value of lat1 - lat2,
338
- # plus the absolute value of lng1 - lng2. Your courses and points of interest (poi) are defined
339
- # in the yaml file.
149
+ * Gooby project site is http://www.joakim-systems.com/gooby
340
150
 
341
- gooby.been_there('1', 0.0025)
342
- gooby.been_there('2', 0.0025)
343
- gooby.been_there('999', 0.0005)
151
+ * Sample maps are available at: http://www.joakim-systems.com/maps
344
152
 
153
+ * Gooby cucumber tests are available at: http://www.joakim-systems.com/cuke
345
154
 
346
- Function 7 - Google Map Generation:
347
- -----------------------------------
348
- shell:
349
-
350
- ruby /devtools/workspace/RF_Gooby/bin/gooby_gen_gmap.rb /devtools/workspace/RF_Gooby/data/20060115_phoenix_marathon.csv > /devtools/workspace/RF_Gooby/samples/20060115_phoenix_marathon.html
351
155
 
352
- ruby /devtools/workspace/RF_Gooby/bin/gooby_gen_gmap.rb /devtools/workspace/RF_Gooby/data/20070505_davidson_5k_km.csv > /devtools/workspace/RF_Gooby/samples/20070505_davidson_5k.html
156
+ == This Release - version 2.0.0
353
157
 
354
- ruby:
158
+ * The gooby 2.0.0 codebase is essentially a complete rewrite, featuring:
355
159
 
356
- require 'rubygems'
357
- require 'gooby'
358
- include REXML
160
+ - 'libxml' is now used for xml parsing instead of 'rexml'.
359
161
 
360
- config_filename = '/devtools/workspace/RF_Gooby/config/gooby_config.yaml'
162
+ - csv creation and reading with 'fastercsv'.
361
163
 
362
- gooby = Gooby::GoobyCommand.new(config_filename)
363
- gooby.generate_google_map(ARGV)
364
-
164
+ - use of cucumber and rspec rather than test/unit for automated testing.
365
165
 
366
- Note: The input file passed to the Google Map generation process is the CSV file, not the Garmin XML file.
166
+ * Simplified functionality:
367
167
 
168
+ - Device focus - parses data from your Garmin 205/305 and Garmin eTrex devices
169
+ via your desktop software such as Garmin Training Center and/or MacGpsPro.
368
170
 
369
- Function 8 - Extract First Trackpoints as (potential) Points-of-Interest (POI)
370
- ------------------------------------------------------------------------------
371
- shell:
171
+ A late addition to this release was gpx xml file support, such as from the
172
+ iPhone "MotionX GPS" application.
372
173
 
373
- ruby /devtools/workspace/RF_Gooby/bin/gooby_first_trackpoints_as_poi.rb
174
+ - Data focus - the specific Garmin device data is formatted into a common csv format.
175
+ You may optionally import the csv files created by gooby into your database of choice.
176
+ Gooby itself, however, does not require the use of a database.
374
177
 
375
- ruby:
178
+ - Google Map html generation, from common csv input.
376
179
 
377
- require 'rubygems'
378
- require 'gooby'
379
- include REXML
180
+ - Google Earth kml generation, from common csv input.
380
181
 
381
- config_filename = '/devtools/workspace/RF_Gooby/config/gooby_config.yaml'
182
+ - The 'GOOBY_HOME' environment variable is required; a user-defined value.
183
+ Rails-like "sensible default" directory structure within your 'GOOBY_HOME' directory.
382
184
 
383
- gooby = Gooby::GoobyCommand.new(config_filename)
185
+ - Configuration yaml files are now a "base plus map-specific" design. A core yaml file
186
+ defines most configuration parameters; while map-specific configuration yaml files
187
+ enable you to override the base values for each particular map you create.
188
+ This results in less need to constantly modify the configuration values for each map
189
+ you want to generate.
384
190
 
385
- # first read the csv file(s) parsed from your Garmin export tcx/xml files.
386
- list = Array.new
387
- list << '/devtools/workspace/RF_Gooby/data/hrm1.csv'
388
- list << '/devtools/workspace/RF_Gooby/data/20050305_corporate_cup_hm.csv'
389
- list << '/devtools/workspace/RF_Gooby/data/20050430_nashville_marathon_km.csv'
390
- list << '/devtools/workspace/RF_Gooby/data/20060115_phoenix_marathon.csv'
391
- list << '/devtools/workspace/RF_Gooby/data/20070101_davidson_11m.csv'
392
- list << '/devtools/workspace/RF_Gooby/data/20070505_davidson_5k_km.csv'
393
- gooby.read_csv_files(list)
191
+ - Focus is on the English system of units, rather than the metric system.
394
192
 
395
- # optional first arg is the date of the run, otherwise the all dates.
396
- gooby.first_trackpoints_as_poi(ARGV[0])
397
193
 
194
+ == Road Map / TODO List
398
195
 
399
- Function 9 - Create a MySQL database table for your parsed CSV data
400
- -------------------------------------------------------------------
401
- shell:
402
-
403
- /usr/local/mysql/bin/mysql < /devtools/workspace/RF_Gooby/sql/gooby.ddl -u <your_db_id> -p
196
+ * No specific plans currently. Future functionality is dependent on my future mapping
197
+ needs, Google API evolution, and user feedback. Interesting ideas are appreciated.
404
198
 
405
199
 
406
- Function 10 - Populate the MySQL database table with your parsed CSV data
407
- -------------------------------------------------------------------------
408
- shell:
200
+ == Support
409
201
 
410
- /usr/local/mysql/bin/mysql < /devtools/workspace/RF_Gooby/sql/gooby_load.dml -u <your_db_id> -p
202
+ * Please see the Tracker page at http://rubyforge.org/projects/gooby/ to submit a request
203
+ or to report a bug.
411
204
 
412
-
205
+
413
206
  == Warranty
414
207
 
415
- This software is provided "as is" and without any express or implied warranties,
416
- including, without limitation, the implied warranties of merchantibility and
417
- fitness for a particular purpose.
208
+ This software is provided "as is" and without any express or implied warranties, including,
209
+ without limitation, the implied warranties of merchantibility and fitness for a particular purpose.
418
210