gooby 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. data/README +144 -180
  2. data/bin/example_usage.txt +55 -0
  3. data/bin/gooby_been_there.rb +35 -0
  4. data/bin/gooby_config.rb +16 -0
  5. data/bin/gooby_gen_gmap.rb +16 -0
  6. data/bin/gooby_parser.rb +19 -0
  7. data/bin/gooby_splitter.rb +18 -0
  8. data/bin/gooby_version.rb +16 -0
  9. data/bin/run_all.sh +23 -0
  10. data/bin/run_been_there.sh +16 -0
  11. data/bin/run_db_gen.sh +11 -0
  12. data/bin/run_db_load.sh +11 -0
  13. data/bin/run_gen_gmaps.sh +20 -0
  14. data/bin/run_parse.sh +43 -0
  15. data/bin/run_parse_named.sh +19 -0
  16. data/bin/run_split.sh +23 -0
  17. data/config/gooby_config.yaml +137 -0
  18. data/data/20050305_corporate_cup_hm.csv +251 -251
  19. data/data/20050430_nashville_marathon.csv +1208 -1208
  20. data/data/20060115_phoenix_marathon.csv +1280 -1280
  21. data/data/davidson_11m_20070101.csv +251 -0
  22. data/data/davidson_11m_20070101.xml +2020 -0
  23. data/data/davidson_5K_20070505.csv +286 -0
  24. data/data/davidson_5K_20070505.xml +2875 -0
  25. data/lib/gooby.rb +889 -361
  26. data/samples/20050305_corporate_cup_hm.html +270 -270
  27. data/samples/20050430_nashville_marathon.html +1240 -1240
  28. data/samples/20060115_phoenix_marathon.html +1312 -1312
  29. data/samples/been_there.txt +744 -0
  30. data/samples/davidson_11m_20070101.html +432 -0
  31. data/samples/davidson_5K_20070505.html +395 -0
  32. data/sql/gooby.ddl +56 -0
  33. data/sql/gooby_load.dml +35 -0
  34. metadata +30 -32
  35. data/bin/20050305_corporate_cup_hm_to_csv.rb +0 -9
  36. data/bin/20050430_nashville_marathon_to_csv.rb +0 -9
  37. data/bin/20060115_phoenix_marathon_to_csv.rb +0 -9
  38. data/bin/activity_2007_03_10_13_02_32.xml_to_csv.rb +0 -9
  39. data/bin/example_usage.rb +0 -46
  40. data/bin/example_usage.sh +0 -52
  41. data/bin/gen_gap_phx.rb +0 -10
  42. data/bin/gen_gmap_cc_2005.rb +0 -10
  43. data/bin/gen_gmap_cc_2007.rb +0 -10
  44. data/bin/gen_gmap_nashville.rb +0 -10
  45. data/bin/gen_gmap_phx.rb +0 -10
  46. data/bin/phx_to_csv.rb +0 -47
  47. data/bin/split_forerunner_logbook_2007.rb +0 -10
  48. data/bin/split_training_center_2007.rb +0 -8
  49. data/data/2007_03_10.tcx +0 -28445
  50. data/data/activity_2007_03_10_13_02_32.csv +0 -1168
  51. data/data/activity_2007_03_10_13_02_32.xml +0 -11695
  52. data/data/forerunner_2007.xml +0 -31872
  53. data/data/geo_data.txt +0 -171
  54. data/pkg/code_header.txt +0 -21
  55. data/pkg/pkg.rb +0 -238
  56. data/pkg/test_header.txt +0 -19
  57. data/samples/20070310_corporate_cup_hm.html +0 -1367
  58. data/samples/gps_point_capture.html +0 -54
  59. data/samples/phoenix_marathon.html +0 -1596
  60. data/tests/ts_gooby.rb +0 -1109
  61. data/tests/ts_gooby_min.rb +0 -550
data/sql/gooby.ddl ADDED
@@ -0,0 +1,56 @@
1
+ -- ***************************************************************************
2
+ -- Gooby - Copyright 2007 by Chris Joakim. 2007/06/10.
3
+ -- Gooby is available under GNU General Public License (GPL) license.
4
+ -- ============================================================================
5
+ --
6
+ -- DDL to drop and (re)create the MySQL 'gooby' database for Gooby 1.1.0.
7
+ --
8
+ -- Execute from shell via command:
9
+ -- /usr/local/mysql/bin/mysql < gooby.ddl -u <uid> -p
10
+ --
11
+ -- Example data - each line contains the following pipe-delimited fields:
12
+ -- column index value
13
+ -- --------------- ----- --------------------
14
+ -- primary_key 0 2007-03-03T15:58:57Z.3
15
+ -- run_id 1 2007-03-03T15:58:57Z
16
+ -- date 2 2007-03-03
17
+ -- time 3 15:59:06
18
+ -- tkpt_num 4 3
19
+ -- latitude 5 35.492118
20
+ -- longitude 6 -80.832979
21
+ -- altitude_ft 7 818.66254272
22
+ -- run_distance 8 0.0161674682166431
23
+ -- run_elapsed 9 00:00:09
24
+ -- lap_tkpt_number 10 3
25
+ -- lap_distance 11 0.0161674682166431
26
+ -- lap_elapsed 12 00:00:09
27
+ --
28
+ -- ***************************************************************************
29
+
30
+ create database if not exists gooby;
31
+
32
+ use gooby;
33
+
34
+ -- ============================================================================
35
+ -- This table contains GPS data parsed from Garmin export files.
36
+
37
+ drop table if exists gps_data;
38
+
39
+ create table gps_data (
40
+ id varchar(32),
41
+ run_id varchar(24),
42
+ run_date date,
43
+ run_time time,
44
+ tkpt_num smallint,
45
+ latitude decimal(13,10),
46
+ longitude decimal(13,10),
47
+ altitude_ft decimal(15,10),
48
+ run_distance decimal(16,10),
49
+ run_elapsed time,
50
+ lap_tkpt_number smallint,
51
+ lap_distance decimal(16,10),
52
+ lap_elapsed time,
53
+ primary key(id)
54
+ );
55
+
56
+ describe gps_data;
@@ -0,0 +1,35 @@
1
+ -- ***************************************************************************
2
+ -- Gooby - Copyright 2007 by Chris Joakim. 2007/06/10.
3
+ -- Gooby is available under GNU General Public License (GPL) license.
4
+ -- ============================================================================
5
+ --
6
+ -- DML to load the MySQL 'gooby' database 'gps_data' for Gooby 1.1.0.
7
+ -- See file 'gooby.ddl' which contains the DDL statements to create the DB.
8
+ --
9
+ -- Execute from shell via command:
10
+ -- /usr/local/mysql/bin/mysql < gooby_load.dml -u <uid> -p
11
+ --
12
+ -- **************************************************************************
13
+
14
+ use gooby;
15
+
16
+ -- Query the row count before loading.
17
+ select count(*) from gps_data;
18
+
19
+ LOAD DATA INFILE '/devtools/workspace/RF_Gooby/data/2007_g201.csv'
20
+ INTO TABLE gooby.gps_data
21
+ FIELDS TERMINATED BY '|'
22
+ LINES TERMINATED BY '\n'
23
+ IGNORE 1 LINES;
24
+
25
+ LOAD DATA INFILE '/devtools/workspace/RF_Gooby/data/2007_g205.csv'
26
+ INTO TABLE gooby.gps_data
27
+ FIELDS TERMINATED BY '|'
28
+ LINES TERMINATED BY '\n'
29
+ IGNORE 1 LINES;
30
+
31
+ -- Query the data after loading.
32
+ select count(*) from gps_data;
33
+ select distinct run_id from gps_data;
34
+ select * from gps_data where id = '2007-01-01T16:38:26Z.1'; -- garmin 201
35
+ select * from gps_data where id = '2007-06-09T11:20:58Z.1048'; -- garmin 205
metadata CHANGED
@@ -3,12 +3,12 @@ rubygems_version: 0.9.2
3
3
  specification_version: 1
4
4
  name: gooby
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.0.0
7
- date: 2007-03-21 00:00:00 -04:00
6
+ version: 1.1.0
7
+ date: 2007-06-10 00:00:00 -04:00
8
8
  summary: Google APIs + Ruby = Gooby
9
9
  require_paths:
10
10
  - lib
11
- email: chris@joakimsoftware.com
11
+ email: chris@joakim-systems.com
12
12
  homepage: http://rubyforge.org/projects/gooby/
13
13
  rubyforge_project: gooby
14
14
  description:
@@ -29,32 +29,33 @@ post_install_message:
29
29
  authors:
30
30
  - Chris Joakim
31
31
  files:
32
- - bin/20050305_corporate_cup_hm_to_csv.rb
33
- - bin/20050430_nashville_marathon_to_csv.rb
34
- - bin/20060115_phoenix_marathon_to_csv.rb
35
- - bin/activity_2007_03_10_13_02_32.xml_to_csv.rb
36
32
  - bin/code_scan.rb
37
- - bin/example_usage.rb
38
- - bin/example_usage.sh
39
- - bin/gen_gap_phx.rb
40
- - bin/gen_gmap_cc_2005.rb
41
- - bin/gen_gmap_cc_2007.rb
42
- - bin/gen_gmap_nashville.rb
43
- - bin/gen_gmap_phx.rb
44
- - bin/phx_to_csv.rb
45
- - bin/split_forerunner_logbook_2007.rb
46
- - bin/split_training_center_2007.rb
33
+ - bin/example_usage.txt
34
+ - bin/gooby_been_there.rb
35
+ - bin/gooby_config.rb
36
+ - bin/gooby_gen_gmap.rb
37
+ - bin/gooby_parser.rb
38
+ - bin/gooby_splitter.rb
39
+ - bin/gooby_version.rb
40
+ - bin/run_all.sh
41
+ - bin/run_been_there.sh
42
+ - bin/run_db_gen.sh
43
+ - bin/run_db_load.sh
44
+ - bin/run_gen_gmaps.sh
45
+ - bin/run_parse.sh
46
+ - bin/run_parse_named.sh
47
+ - bin/run_split.sh
48
+ - config/gooby_config.yaml
47
49
  - data/20050305_corporate_cup_hm.csv
48
50
  - data/20050305_corporate_cup_hm.xml
49
51
  - data/20050430_nashville_marathon.csv
50
52
  - data/20050430_nashville_marathon.xml
51
53
  - data/20060115_phoenix_marathon.csv
52
54
  - data/20060115_phoenix_marathon.xml
53
- - data/2007_03_10.tcx
54
- - data/activity_2007_03_10_13_02_32.csv
55
- - data/activity_2007_03_10_13_02_32.xml
56
- - data/forerunner_2007.xml
57
- - data/geo_data.txt
55
+ - data/davidson_11m_20070101.csv
56
+ - data/davidson_11m_20070101.xml
57
+ - data/davidson_5K_20070505.csv
58
+ - data/davidson_5K_20070505.xml
58
59
  - data/test1.txt
59
60
  - img/gicons
60
61
  - img/gicons/blank.png
@@ -186,20 +187,17 @@ files:
186
187
  - img/gicons/readme.txt
187
188
  - img/gicons/shadow50.png
188
189
  - lib/gooby.rb
189
- - pkg/code_header.txt
190
- - pkg/pkg.rb
191
- - pkg/test_header.txt
192
190
  - samples/20050305_corporate_cup_hm.html
193
191
  - samples/20050430_nashville_marathon.html
194
192
  - samples/20060115_phoenix_marathon.html
195
- - samples/20070310_corporate_cup_hm.html
196
- - samples/gps_point_capture.html
197
- - samples/phoenix_marathon.html
198
- - tests/ts_gooby.rb
199
- - tests/ts_gooby_min.rb
193
+ - samples/been_there.txt
194
+ - samples/davidson_11m_20070101.html
195
+ - samples/davidson_5K_20070505.html
196
+ - sql/gooby.ddl
197
+ - sql/gooby_load.dml
200
198
  - README
201
- test_files:
202
- - tests/ts_gooby_min.rb
199
+ test_files: []
200
+
203
201
  rdoc_options: []
204
202
 
205
203
  extra_rdoc_files:
@@ -1,9 +0,0 @@
1
-
2
- $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
3
-
4
- require 'gooby'
5
- include REXML
6
-
7
- gooby = Gooby::GoobyCommand.new
8
- gooby.parse_garmin_forerunner_logbook_xml 'data/20050305_corporate_cup_hm.xml'
9
-
@@ -1,9 +0,0 @@
1
-
2
- $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
3
-
4
- require 'gooby'
5
- include REXML
6
-
7
- gooby = Gooby::GoobyCommand.new
8
- gooby.parse_garmin_forerunner_logbook_xml 'data/20050430_nashville_marathon.xml'
9
-
@@ -1,9 +0,0 @@
1
-
2
- $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
3
-
4
- require 'gooby'
5
- include REXML
6
-
7
- gooby = Gooby::GoobyCommand.new
8
- gooby.parse_garmin_forerunner_logbook_xml 'data/20060115_phoenix_marathon.xml'
9
-
@@ -1,9 +0,0 @@
1
-
2
- $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
3
-
4
- require 'gooby'
5
- include REXML
6
-
7
- gooby = Gooby::GoobyCommand.new
8
- gooby.parse_garmin_training_center_xml 'data/activity_2007_03_10_13_02_32.xml'
9
-
data/bin/example_usage.rb DELETED
@@ -1,46 +0,0 @@
1
- =begin rdoc
2
-
3
- This file contains examples of how to use Gooby.
4
-
5
- You will probably have to change the input filenames (yaml, xml, csv)
6
- to your own filenames on your computer.
7
-
8
- =end
9
-
10
- # The following prefixes ../lib to the active ruby load path
11
- $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
12
-
13
- require 'gooby'
14
- include REXML
15
-
16
- # First, create a GoobyCommand object.
17
- gooby = Gooby::GoobyCommand.new
18
-
19
- # Next, create an Options object from the given yaml file - see the sample
20
- # 'gooby_options.yaml' file in the distribution.
21
- options_file = 'gooby_options.yaml'
22
- options = gooby.options(options_file)
23
-
24
- # Optionally display some of its values.
25
- n = 'gmap_approx_max_points'
26
- v = options.get(n)
27
- puts "option '#{n}' = #{v}"
28
-
29
- # Split a large Garmin ForerunnerLogbook XML file into individual 'run' files.
30
- # In this example, '/temp' is the output directory.
31
- gooby.split_garmin_forerunner_logbook_xml('data/forerunner_2007.xml', '/temp') if true
32
-
33
- # Split a large Garmin TrainingCenter TCX(XML) file into individual 'activity' files.
34
- gooby.split_garmin_training_center_xml('data/2007_03_10.tcx', '/temp') if true
35
-
36
- # Parse a Garmin ForerunnerLogbook XML file, or previously 'split' subset, into CSV.
37
- # You may want to redirect this output to a file.
38
- gooby.parse_garmin_forerunner_logbook_xml 'data/run_2007_01_01_16_38_27.xml' if true
39
-
40
- # Parse a TrainingCenter TCX(XML) file, or previously 'split' subset, into CSV.
41
- gooby.parse_garmin_training_center_xml 'data/activity_2007_03_04_15_22_36.xml' if true
42
-
43
- # Generate a Google Map from your CSV file data, and the Options per
44
- # your yaml file. You may also wish to redirect this output to a file.
45
- gooby.generate_google_map('data/phx.csv', options) if true
46
-
data/bin/example_usage.sh DELETED
@@ -1,52 +0,0 @@
1
-
2
- echo splitting forerunner logbook 2007 file
3
- ruby bin/split_forerunner_logbook_2007.rb
4
- echo
5
-
6
- echo splitting training center 2007 file
7
- ruby bin/split_training_center_2007.rb
8
- echo
9
-
10
- echo parsing data/20050305_corporate_cup_hm.xml
11
- ruby bin/20050305_corporate_cup_hm_to_csv.rb > data/20050305_corporate_cup_hm.csv
12
- head -3 data/20050305_corporate_cup_hm.csv
13
- echo ...
14
- tail -3 data/20050305_corporate_cup_hm.csv
15
- echo
16
-
17
- echo parsing data/20050430_nashville_marathon.xml
18
- ruby bin/20050430_nashville_marathon_to_csv.rb > data/20050430_nashville_marathon.csv
19
- head -3 data/20050430_nashville_marathon.csv
20
- echo ...
21
- tail -3 data/20050430_nashville_marathon.csv
22
- echo
23
-
24
- echo parsing data/20060115_phoenix_marathon.xml
25
- ruby bin/20060115_phoenix_marathon_to_csv.rb > data/20060115_phoenix_marathon.csv
26
- head -3 data/20060115_phoenix_marathon.csv
27
- echo ...
28
- tail -3 data/20060115_phoenix_marathon.csv
29
- echo
30
-
31
- echo parsing data/activity_2007_03_10_13_02_32.csv
32
- ruby bin/activity_2007_03_10_13_02_32.xml_to_csv.rb > data/activity_2007_03_10_13_02_32.csv
33
- head -3 data/activity_2007_03_10_13_02_32.csv
34
- echo ...
35
- tail -3 data/activity_2007_03_10_13_02_32.csv
36
- echo
37
-
38
- echo generating corporate cup hm 2005 map
39
- ruby bin/gen_gmap_cc_2005.rb > samples/20050305_corporate_cup_hm.html
40
-
41
- echo generating nashville marathon map
42
- ruby bin/gen_gmap_nashville.rb > samples/20050430_nashville_marathon.html
43
-
44
- echo generating phoenix marthon map
45
- ruby bin/gen_gmap_phx.rb > samples/20060115_phoenix_marathon.html
46
-
47
- echo generating corporate cup hm 2007 map
48
- ruby bin/gen_gmap_cc_2007.rb > samples/20070310_corporate_cup_hm.html
49
-
50
- echo done
51
-
52
-
data/bin/gen_gap_phx.rb DELETED
@@ -1,10 +0,0 @@
1
-
2
- $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
3
-
4
- require 'gooby'
5
- include REXML
6
-
7
- gooby = Gooby::GoobyCommand.new
8
- options_file = 'gooby_options.yaml'
9
- options = gooby.options(options_file)
10
- gooby.generate_google_map('data/phx.csv', options)
@@ -1,10 +0,0 @@
1
-
2
- $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
3
-
4
- require 'gooby'
5
- include REXML
6
-
7
- gooby = Gooby::GoobyCommand.new
8
- options_file = 'gooby_options.yaml'
9
- options = gooby.options(options_file)
10
- gooby.generate_google_map('data/20050305_corporate_cup_hm.csv', options)
@@ -1,10 +0,0 @@
1
-
2
- $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
3
-
4
- require 'gooby'
5
- include REXML
6
-
7
- gooby = Gooby::GoobyCommand.new
8
- options_file = 'gooby_options.yaml'
9
- options = gooby.options(options_file)
10
- gooby.generate_google_map('data/activity_2007_03_10_13_02_32.csv', options)
@@ -1,10 +0,0 @@
1
-
2
- $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
3
-
4
- require 'gooby'
5
- include REXML
6
-
7
- gooby = Gooby::GoobyCommand.new
8
- options_file = 'gooby_options.yaml'
9
- options = gooby.options(options_file)
10
- gooby.generate_google_map('data/20050430_nashville_marathon.csv', options)
data/bin/gen_gmap_phx.rb DELETED
@@ -1,10 +0,0 @@
1
-
2
- $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
3
-
4
- require 'gooby'
5
- include REXML
6
-
7
- gooby = Gooby::GoobyCommand.new
8
- options_file = 'gooby_options.yaml'
9
- options = gooby.options(options_file)
10
- gooby.generate_google_map('data/20060115_phoenix_marathon.csv', options)
data/bin/phx_to_csv.rb DELETED
@@ -1,47 +0,0 @@
1
- =begin rdoc
2
-
3
- This file contains examples of how to use Gooby.
4
-
5
- You will probably have to change the input filenames (yaml, xml, csv)
6
- to your own filenames on your computer.
7
-
8
- =end
9
-
10
- # The following prefixes ../lib to the active ruby load path
11
- $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
12
-
13
- require 'gooby'
14
-
15
- include REXML
16
-
17
- # First, create a GoobyCommand object.
18
- gooby = Gooby::GoobyCommand.new
19
-
20
- # Next, create an Options object from the given yaml file - see the sample
21
- # 'gooby_options.yaml' file in the distribution.
22
- options_file = 'gooby_options.yaml'
23
- options = gooby.options(options_file)
24
-
25
- # Optionally display some of its values.
26
- n = 'gmap_approx_max_points'
27
- v = options.get(n)
28
- puts "option '#{n}' = #{v}"
29
-
30
- # Split a large Garmin ForerunnerLogbook XML file into individual 'run' files.
31
- # In this example, '/temp' is the output directory.
32
- gooby.split_garmin_forerunner_logbook_xml('data/forerunner_2007.xml', '/temp') if true
33
-
34
- # Split a large Garmin TrainingCenter TCX(XML) file into individual 'activity' files.
35
- gooby.split_garmin_training_center_xml('data/2007_03_10.tcx', '/temp') if true
36
-
37
- # Parse a Garmin ForerunnerLogbook XML file, or previously 'split' subset, into CSV.
38
- # You may want to redirect this output to a file.
39
- gooby.parse_garmin_forerunner_logbook_xml 'data/run_2007_01_01_16_38_27.xml' if true
40
-
41
- # Parse a TrainingCenter TCX(XML) file, or previously 'split' subset, into CSV.
42
- gooby.parse_garmin_training_center_xml 'data/activity_2007_03_04_15_22_36.xml' if true
43
-
44
- # Generate a Google Map from your CSV file data, and the Options per
45
- # your yaml file. You may also wish to redirect this output to a file.
46
- gooby.generate_google_map('data/phx.csv', options) if true
47
-
@@ -1,10 +0,0 @@
1
-
2
- # The following prefixes ../lib to the active ruby load path
3
- $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
4
-
5
- require 'gooby'
6
- include REXML
7
-
8
- gooby = Gooby::GoobyCommand.new
9
- gooby.split_garmin_forerunner_logbook_xml('data/forerunner_2007.xml', '/temp')
10
-