tf1_converter 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile.lock +1 -1
- data/example/windowsconfig.yml +26 -26
- data/lib/tf1_converter/csv_file.rb +19 -0
- data/lib/tf1_converter/translation.rb +4 -0
- data/lib/tf1_converter/version.rb +1 -1
- metadata +5 -4
data/Gemfile.lock
CHANGED
data/example/windowsconfig.yml
CHANGED
@@ -1,32 +1,32 @@
|
|
1
1
|
tf1_converter:
|
2
|
-
input: c:\Documents and Settings\FEMA\TF1Converter\Input
|
3
|
-
output: c:\Documents and Settings\FEMA\TF1Converter\Output
|
2
|
+
input: c:\Documents and Settings\FEMA\TF1Converter\Input
|
3
|
+
output: c:\Documents and Settings\FEMA\TF1Converter\Output
|
4
4
|
icon_path: c:\Program Files\GPX2KML\icon\tf_ge\
|
5
5
|
start_path: c:\Program Files\GPX2KML\test
|
6
6
|
end_path: c:\Program Files\GPX2KML\test
|
7
|
-
icons: { Custom 0: { icon: 01.png, meaning: Search Start },
|
8
|
-
Custom 1: { icon: 02.png, meaning: Search Stop},
|
9
|
-
Custom 2: { icon: 03.png, meaning: Victim Detected},
|
10
|
-
Custom 3: { icon: 04.png, meaning: Victim Confirmed},
|
11
|
-
Custom 4: { icon: 05.png, meaning: Meaning 5},
|
12
|
-
Custom 5: { icon: 06.png, meaning: Meaning 6},
|
13
|
-
Custom 6: { icon: 07.png, meaning: Meaning 7},
|
14
|
-
Custom 7: { icon: 08.png, meaning: Meaning 8},
|
15
|
-
Custom 8: { icon: 09.png, meaning: Meaning 9},
|
16
|
-
Custom 9: { icon: 10.png, meaning: Meaning 10},
|
17
|
-
Custom 10: { icon: 11.png, meaning: Collection Point },
|
18
|
-
Custom 11: { icon: 12.png, meaning: Meaning 12},
|
19
|
-
Custom 12: { icon: 13.png, meaning: Command Post },
|
20
|
-
Custom 13: { icon: 14.png, meaning: Staging Area},
|
21
|
-
Custom 14: { icon: 15.png, meaning: Criminal Activity },
|
22
|
-
Custom 15: { icon: 16.png, meaning: Meaning 16},
|
23
|
-
Custom 16: { icon: 17.png, meaning: Water Level},
|
24
|
-
Custom 17: { icon: 18.png, meaning: Structure Damage / Safe },
|
25
|
-
Custom 18: { icon: 19.png, meaning: Meaning 19},
|
26
|
-
Custom 19: { icon: 20.png, meaning: Structure Not Safe },
|
27
|
-
Custom 20: { icon: 21.png, meaning: Extra 21 },
|
28
|
-
Custom 21: { icon: 22.png, meaning: Extra 22 },
|
29
|
-
Custom 22: { icon: 23.png, meaning: Extra 23},
|
30
|
-
Residence: { icon: default.png, meaning: Default } }
|
7
|
+
icons: { Custom 0: { icon: 01.png, meaning: Search Start, name: name1 },
|
8
|
+
Custom 1: { icon: 02.png, meaning: Search Stop, name: name2},
|
9
|
+
Custom 2: { icon: 03.png, meaning: Victim Detected, name: name3},
|
10
|
+
Custom 3: { icon: 04.png, meaning: Victim Confirmed, name: name4},
|
11
|
+
Custom 4: { icon: 05.png, meaning: Meaning 5, name: name5},
|
12
|
+
Custom 5: { icon: 06.png, meaning: Meaning 6, name: name6},
|
13
|
+
Custom 6: { icon: 07.png, meaning: Meaning 7, name: name7},
|
14
|
+
Custom 7: { icon: 08.png, meaning: Meaning 8, name: name8},
|
15
|
+
Custom 8: { icon: 09.png, meaning: Meaning 9, name: name9},
|
16
|
+
Custom 9: { icon: 10.png, meaning: Meaning 10, name: name10},
|
17
|
+
Custom 10: { icon: 11.png, meaning: Collection Point, name: name11 },
|
18
|
+
Custom 11: { icon: 12.png, meaning: Meaning 12, name: name12},
|
19
|
+
Custom 12: { icon: 13.png, meaning: Command Post, name: name13 },
|
20
|
+
Custom 13: { icon: 14.png, meaning: Staging Area, name: name14},
|
21
|
+
Custom 14: { icon: 15.png, meaning: Criminal Activity, name: name15 },
|
22
|
+
Custom 15: { icon: 16.png, meaning: Meaning 16, name: name16},
|
23
|
+
Custom 16: { icon: 17.png, meaning: Water Level, name: name17},
|
24
|
+
Custom 17: { icon: 18.png, meaning: Structure Damage / Safe, name: name18 },
|
25
|
+
Custom 18: { icon: 19.png, meaning: Meaning 19, name: name19},
|
26
|
+
Custom 19: { icon: 20.png, meaning: Structure Not Safe, name: name20 },
|
27
|
+
Custom 20: { icon: 21.png, meaning: Extra 21, name: name21 },
|
28
|
+
Custom 21: { icon: 22.png, meaning: Extra 22, name: name22 },
|
29
|
+
Custom 22: { icon: 23.png, meaning: Extra 23, name: name23},
|
30
|
+
Residence: { icon: default.png, meaning: Default, name: name24 } }
|
31
31
|
colors: { DarkRed: f0000080,
|
32
32
|
Yellow: f000ffff }
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'csv'
|
2
|
+
|
3
|
+
module TF1Converter
|
4
|
+
class CsvFile
|
5
|
+
def initialize(waypoints, path)
|
6
|
+
@waypoints = waypoints
|
7
|
+
@path = path
|
8
|
+
end
|
9
|
+
|
10
|
+
def to_csv!
|
11
|
+
CSV.open(@path, 'wb') do |csv|
|
12
|
+
csv << ['filename', 'name', 'meaning', 'time', 'lat', 'long', 'usng', 'utm']
|
13
|
+
@waypoints.each do |wp|
|
14
|
+
csv << [@path.split('.').first, wp.name, wp.icon_meaning, wp.timestamp, wp.lat, wp.long, wp.usng, wp.utm]
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -2,6 +2,7 @@ require 'nokogiri'
|
|
2
2
|
require 'geo_swap'
|
3
3
|
require_relative 'gpx_file'
|
4
4
|
require_relative 'kml_file'
|
5
|
+
require_relative 'csv_file'
|
5
6
|
|
6
7
|
module TF1Converter
|
7
8
|
class Translation
|
@@ -16,6 +17,9 @@ module TF1Converter
|
|
16
17
|
end
|
17
18
|
|
18
19
|
def into(output_file)
|
20
|
+
csv_path =output_file.path.split('.').first + '.csv'
|
21
|
+
CsvFile.new(@gpx.waypoints, csv_path).to_csv!
|
22
|
+
|
19
23
|
kml = KmlFile.new(@gpx.waypoints, @gpx.tracks).to_xml
|
20
24
|
output_file.puts kml
|
21
25
|
output_file.close
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tf1_converter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02-
|
12
|
+
date: 2013-02-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -160,6 +160,7 @@ files:
|
|
160
160
|
- input/test.gpx
|
161
161
|
- lib/tf1_converter.rb
|
162
162
|
- lib/tf1_converter/config.rb
|
163
|
+
- lib/tf1_converter/csv_file.rb
|
163
164
|
- lib/tf1_converter/gpx/track.rb
|
164
165
|
- lib/tf1_converter/gpx/trackpoint.rb
|
165
166
|
- lib/tf1_converter/gpx/waypoint.rb
|
@@ -194,7 +195,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
194
195
|
version: '0'
|
195
196
|
segments:
|
196
197
|
- 0
|
197
|
-
hash:
|
198
|
+
hash: -105636011424227651
|
198
199
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
199
200
|
none: false
|
200
201
|
requirements:
|
@@ -203,7 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
203
204
|
version: '0'
|
204
205
|
segments:
|
205
206
|
- 0
|
206
|
-
hash:
|
207
|
+
hash: -105636011424227651
|
207
208
|
requirements: []
|
208
209
|
rubyforge_project:
|
209
210
|
rubygems_version: 1.8.23
|