open_gpx_2_kml 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ *.swp
2
+ *.DS_Store
3
+ pkg/*
4
+ output/*
5
+ output.kml
6
+ example/localconfig.csv
7
+ spec/fixtures/*.csv
8
+ spec/fixtures/test.kml
9
+ spec/fixtures/waypoint-by-name.kml
10
+ spec/fixtures/ftwood2.kml
11
+ spec/fixtures/*.kmz
data/.rbenv-version ADDED
@@ -0,0 +1 @@
1
+ 1.9.3-p327
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,46 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ open_gpx_2_kml (0.9.1)
5
+ builder (= 3.1.4)
6
+ geo_swap (= 0.2.1)
7
+ nokogiri (= 1.5.6)
8
+ rubyzip (= 0.9.9)
9
+ thor (= 0.17.0)
10
+
11
+ GEM
12
+ remote: https://rubygems.org/
13
+ specs:
14
+ builder (3.1.4)
15
+ coderay (1.0.8)
16
+ diff-lcs (1.1.3)
17
+ geo_swap (0.2.1)
18
+ method_source (0.8.1)
19
+ nokogiri (1.5.6)
20
+ pry (0.9.11.4)
21
+ coderay (~> 1.0.5)
22
+ method_source (~> 0.8)
23
+ slop (~> 3.4)
24
+ rake (10.0.3)
25
+ rspec (2.12.0)
26
+ rspec-core (~> 2.12.0)
27
+ rspec-expectations (~> 2.12.0)
28
+ rspec-mocks (~> 2.12.0)
29
+ rspec-core (2.12.2)
30
+ rspec-expectations (2.12.1)
31
+ diff-lcs (~> 1.1.3)
32
+ rspec-mocks (2.12.1)
33
+ rubyzip (0.9.9)
34
+ slop (3.4.3)
35
+ thor (0.17.0)
36
+ timecop (0.5.9.2)
37
+
38
+ PLATFORMS
39
+ ruby
40
+
41
+ DEPENDENCIES
42
+ open_gpx_2_kml!
43
+ pry (= 0.9.11.4)
44
+ rake (= 10.0.3)
45
+ rspec (= 2.12.0)
46
+ timecop (= 0.5.9.2)
data/README.md ADDED
@@ -0,0 +1,17 @@
1
+ ### INSTALLATION
2
+
3
+ ## WINDOWS
4
+
5
+ 1) Install ruby (http://rubyinstaller.org), must be ruby 1.9 or above.
6
+
7
+ 2) Make sure ruby is on the path (ruby is installed at C:\Ruby193 or similar,
8
+ follow these directions to modify your path: http://www.computerhope.com/issues/ch000549.htm#1)
9
+
10
+ 3) install the converter by running this at the command prompt:
11
+
12
+ gem install tf1_converter
13
+
14
+
15
+ 4) add a config file to a convenient location (see example/config.csv)
16
+
17
+ 5) edit the config file in WordPad or similar, make sure the paths match where your files are.
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
data/bin/openGpx2Kml ADDED
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'tf1_converter'
4
+
5
+ config_file = ARGV[0]
6
+ TF1Converter::Config.load(config_file)
7
+ input_path = TF1Converter::Config.input
8
+ output_path = TF1Converter::Config.output
9
+
10
+ Dir.foreach(input_path) do |file|
11
+ unless ['.', '..'].include? file
12
+ input = File.open("#{input_path}/#{file}", 'r')
13
+ outfile = file.gsub(/\.gpx$/, '.kml')
14
+ output = File.open("#{output_path}/#{outfile}", 'w')
15
+ TF1Converter::Translation.from(input).into(output)
16
+ end
17
+ end
18
+
19
+ Dir.foreach(output_path) do |file|
20
+ File.delete(file) if file =~ /\.kml$/
21
+ end
@@ -0,0 +1,57 @@
1
+ The path of the directory where you are putting gpx files
2
+ INPUT
3
+ input
4
+
5
+ The path of the directory where you are wanting the KML files
6
+ OUTPUT
7
+ output
8
+
9
+ The full path of the directory where your icons are stored
10
+ ICON_PATH
11
+ /Users/ethanvizitei/icons
12
+
13
+ Table of Icons (symbol/filename/meaning/custom_name)
14
+ ICONS
15
+ Custom 0,01.png,Search Start,icon_name_1
16
+ Custom 1,02.png,Search Stop,icon_name_2
17
+ Custom 2,03.png,Victim Detected,icon_name_3
18
+ Custom 3,04.png,Victim Confirmed,icon_name_4
19
+ Custom 4,05.png,Meaning 5,icon_name_5
20
+ Custom 5,06.png,Meaning 6,icon_name_6
21
+ Custom 6,07.png,Meaning 7,icon_name_7
22
+ Custom 7,08.png,Meaning 8,icon_name_8
23
+ Custom 8,09.png,Meaning 9,icon_name_9
24
+ Custom 9,10.png,Meaning 10,icon_name_10
25
+ Custom 10,11.png,Collection Point,icon_name_11
26
+ Custom 11,12.png,Meaning 12,icon_name_12
27
+ Custom 12,13.png,Command Post,icon_name_13
28
+ Custom 13,14.png,Staging Area,icon_name_14
29
+ Custom 14,15.png,Criminal Activity,icon_name_15
30
+ Custom 15,16.png,Meaning 16,icon_name_16
31
+ Custom 16,17.png,Water Level,icon_name_17
32
+ Custom 17,18.png,Structure Damage / Safe,icon_name_18
33
+ Custom 18,19.png,Meaning 19,icon_name_19
34
+ Custom 19,20.png,Structure Not Safe,icon_name_20
35
+ Custom 20,21.png,Extra 21,icon_name_21
36
+ Custom 21,22.png,Extra 22,icon_name_22
37
+ Custom 22,23.png,Extra 23,icon_name_23
38
+ Residence,default.png,Default,icon_name_24
39
+
40
+ Table of Colors (Name/KML Hex)
41
+ COLORS
42
+ DarkRed,f0000080
43
+ Yellow,f000ffff
44
+ Blue,f0ff0000
45
+ Red,f01400ff
46
+ Orange,f014b4ff
47
+ Green,f000b414
48
+ Purple,f0ff7878
49
+ Pink,f0ff78f0
50
+
51
+ Switch for Using Constant Color ('true' for one color, 'false' for iteration)
52
+ USE_CONSTANT_COLOR
53
+ false
54
+
55
+ The color to use if the constant color switch is flipped (must be a key from the colors table)
56
+ CONSTANT_COLOR
57
+ Blue
@@ -0,0 +1,57 @@
1
+ The path of the directory where you are putting gpx files
2
+ INPUT
3
+ c:\Documents and Settings\FEMA\TF1Converter\Input
4
+
5
+ The path of the directory where you are wanting the KML files
6
+ OUTPUT
7
+ c:\Documents and Settings\FEMA\TF1Converter\Output
8
+
9
+ The full path of the directory where your icons are stored
10
+ ICON_PATH
11
+ c:\program files\gpx2kml\icon\tf_ge\
12
+
13
+ Table of Icons (symbol/filename/meaning/custom_name)
14
+ ICONS
15
+ Custom 0,01.png,Search Start,icon_name_1
16
+ Custom 1,02.png,Search Stop,icon_name_2
17
+ Custom 2,03.png,Victim Detected,icon_name_3
18
+ Custom 3,04.png,Victim Confirmed,icon_name_4
19
+ Custom 4,05.png,Meaning 5,icon_name_5
20
+ Custom 5,06.png,Meaning 6,icon_name_6
21
+ Custom 6,07.png,Meaning 7,icon_name_7
22
+ Custom 7,08.png,Meaning 8,icon_name_8
23
+ Custom 8,09.png,Meaning 9,icon_name_9
24
+ Custom 9,10.png,Meaning 10,icon_name_10
25
+ Custom 10,11.png,Collection Point,icon_name_11
26
+ Custom 11,12.png,Meaning 12,icon_name_12
27
+ Custom 12,13.png,Command Post,icon_name_13
28
+ Custom 13,14.png,Staging Area,icon_name_14
29
+ Custom 14,15.png,Criminal Activity,icon_name_15
30
+ Custom 15,16.png,Meaning 16,icon_name_16
31
+ Custom 16,17.png,Water Level,icon_name_17
32
+ Custom 17,18.png,Structure Damage / Safe,icon_name_18
33
+ Custom 18,19.png,Meaning 19,icon_name_19
34
+ Custom 19,20.png,Structure Not Safe,icon_name_20
35
+ Custom 20,21.png,Extra 21,icon_name_21
36
+ Custom 21,22.png,Extra 22,icon_name_22
37
+ Custom 22,23.png,Extra 23,icon_name_23
38
+ Residence,default.png,Default,icon_name_24
39
+
40
+ Table of Colors (Name/KML Hex)
41
+ COLORS
42
+ DarkRed,f0000080
43
+ Yellow,f000ffff
44
+ Blue,f0ff0000
45
+ Red,f01400ff
46
+ Orange,f014b4ff
47
+ Green,f000b414
48
+ Purple,f0ff7878
49
+ Pink,f0ff78f0
50
+
51
+ Switch for Using Constant Color ('true' for one color, 'false' for iteration)
52
+ USE_CONSTANT_COLOR
53
+ false
54
+
55
+ The color to use if the constant color switch is flipped (must be a key from the colors table)
56
+ CONSTANT_COLOR
57
+ Blue
data/harness.rb ADDED
@@ -0,0 +1,16 @@
1
+ # require 'gpx2kml'
2
+
3
+ # g = Gpx2kml.new
4
+ # g.add_files('input/test.gpx')
5
+ # g.build_kml('30e-5')
6
+ # g.save('output/test.kml')
7
+
8
+ require_relative './lib/tf1_converter'
9
+
10
+ require 'fileutils'
11
+ FileUtils.rm('output/test.zip') if File.exists?('output/test.zip')
12
+
13
+ input = File.open('input/test.gpx', 'r')
14
+ output = File.open('output/test.kml', 'w')
15
+ TF1Converter::Config.load('example/localconfig.csv')
16
+ TF1Converter::Translation.from(input).into(output)