gpx2exif 0.0.4 → 0.1.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 +1 -1
- data/Gemfile.lock +3 -8
- data/README.md +28 -0
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/bin/generate_garmin_waypoints +1 -1
- data/bin/geotag_all_images +2 -2
- data/bin/geotag_simulate +2 -2
- data/bin/gpx2png +57 -0
- data/lib/geotagger.rb +9 -0
- data/lib/{gpx2exif → geotagger}/exif_editor.rb +6 -6
- data/lib/{gpx2exif/geo_manager.rb → geotagger/geotagger.rb} +16 -10
- data/lib/geotagger/track_importer.rb +33 -0
- data/lib/gpx2exif.rb +3 -7
- data/lib/gpx2png/base.rb +30 -0
- data/lib/gpx2png/gpx2png.rb +210 -0
- data/lib/gpx2png/osm.rb +51 -0
- data/lib/gpx2png/osm_base.rb +280 -0
- data/lib/gpx2png/renderers/chunky_png_renderer.rb +61 -0
- data/lib/gpx2png/renderers/rmagick_renderer.rb +134 -0
- data/lib/gpx_utils.rb +9 -0
- data/lib/gpx_utils/track_importer.rb +63 -0
- data/lib/{garmin_utils/waypoint_list_generator.rb → gpx_utils/waypoints_exporter.rb} +2 -2
- data/lib/{garmin_utils/gpx_waypoint_parser.rb → gpx_utils/waypoints_importer.rb} +3 -3
- data/lib/mini_exiftool/mini_exiftool.rb +450 -0
- metadata +35 -23
- data/lib/garmin_utils.rb +0 -7
- data/lib/gpx2exif/gpx_parser.rb +0 -71
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gpx2exif
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-07-22 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
16
|
-
requirement: &
|
16
|
+
requirement: &18503860 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *18503860
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: mini_exiftool
|
27
|
-
requirement: &
|
27
|
+
requirement: &18503360 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *18503360
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: builder
|
38
|
-
requirement: &
|
38
|
+
requirement: &18502800 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *18502800
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rspec
|
49
|
-
requirement: &
|
49
|
+
requirement: &18502280 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 2.3.0
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *18502280
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: bundler
|
60
|
-
requirement: &
|
60
|
+
requirement: &18501740 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 1.0.0
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *18501740
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: jeweler
|
71
|
-
requirement: &
|
71
|
+
requirement: &18501240 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: 1.6.4
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *18501240
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: simplecov
|
82
|
-
requirement: &
|
82
|
+
requirement: &18500760 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,12 +87,14 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *18500760
|
91
91
|
description: Mass geotagger using GPX files.
|
92
92
|
email: bobikx@poczta.fm
|
93
93
|
executables:
|
94
94
|
- geotag_all_images
|
95
95
|
- geotag_simulate
|
96
|
+
- generate_garmin_waypoints
|
97
|
+
- gpx2png
|
96
98
|
extensions: []
|
97
99
|
extra_rdoc_files:
|
98
100
|
- LICENSE.txt
|
@@ -107,13 +109,23 @@ files:
|
|
107
109
|
- bin/generate_garmin_waypoints
|
108
110
|
- bin/geotag_all_images
|
109
111
|
- bin/geotag_simulate
|
110
|
-
-
|
111
|
-
- lib/
|
112
|
-
- lib/
|
112
|
+
- bin/gpx2png
|
113
|
+
- lib/geotagger.rb
|
114
|
+
- lib/geotagger/exif_editor.rb
|
115
|
+
- lib/geotagger/geotagger.rb
|
116
|
+
- lib/geotagger/track_importer.rb
|
113
117
|
- lib/gpx2exif.rb
|
114
|
-
- lib/
|
115
|
-
- lib/
|
116
|
-
- lib/
|
118
|
+
- lib/gpx2png/base.rb
|
119
|
+
- lib/gpx2png/gpx2png.rb
|
120
|
+
- lib/gpx2png/osm.rb
|
121
|
+
- lib/gpx2png/osm_base.rb
|
122
|
+
- lib/gpx2png/renderers/chunky_png_renderer.rb
|
123
|
+
- lib/gpx2png/renderers/rmagick_renderer.rb
|
124
|
+
- lib/gpx_utils.rb
|
125
|
+
- lib/gpx_utils/track_importer.rb
|
126
|
+
- lib/gpx_utils/waypoints_exporter.rb
|
127
|
+
- lib/gpx_utils/waypoints_importer.rb
|
128
|
+
- lib/mini_exiftool/mini_exiftool.rb
|
117
129
|
homepage: http://github.com/akwiatkowski/gpx2exif
|
118
130
|
licenses:
|
119
131
|
- LGPLv3
|
@@ -129,7 +141,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
129
141
|
version: '0'
|
130
142
|
segments:
|
131
143
|
- 0
|
132
|
-
hash:
|
144
|
+
hash: -1457558773610326867
|
133
145
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
134
146
|
none: false
|
135
147
|
requirements:
|
data/lib/garmin_utils.rb
DELETED
data/lib/gpx2exif/gpx_parser.rb
DELETED
@@ -1,71 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'nokogiri'
|
3
|
-
|
4
|
-
$:.unshift(File.dirname(__FILE__))
|
5
|
-
|
6
|
-
module Gpx2exif
|
7
|
-
class GpxParser
|
8
|
-
|
9
|
-
THRESHOLD = 5*60
|
10
|
-
|
11
|
-
def initialize
|
12
|
-
@coords = Array.new
|
13
|
-
end
|
14
|
-
|
15
|
-
def add_file(path, time_offset = 0)
|
16
|
-
f = File.new(path)
|
17
|
-
doc = Nokogiri::XML(f)
|
18
|
-
doc.remove_namespaces!
|
19
|
-
a = Array.new
|
20
|
-
error_count = 0
|
21
|
-
|
22
|
-
trackpoints = doc.xpath('//gpx/trk/trkseg/trkpt')
|
23
|
-
trackpoints.each do |wpt|
|
24
|
-
w = {
|
25
|
-
:lat => wpt.xpath('@lat').to_s.to_f,
|
26
|
-
:lon => wpt.xpath('@lon').to_s.to_f,
|
27
|
-
:time => proc_time(wpt.xpath('time').children.first.to_s, time_offset),
|
28
|
-
:alt => wpt.xpath('ele').children.first.to_s.to_f
|
29
|
-
}
|
30
|
-
if not w[:lat].nil? and not w[:lat] == 0.0 and
|
31
|
-
not w[:lon].nil? and not w[:lon] == 0.0 and
|
32
|
-
not w[:time].nil?
|
33
|
-
a << w
|
34
|
-
else
|
35
|
-
error_count += 1
|
36
|
-
end
|
37
|
-
|
38
|
-
end
|
39
|
-
|
40
|
-
f.close
|
41
|
-
|
42
|
-
a = a.sort { |b, c| b[:time] <=> c[:time] }
|
43
|
-
time_substring = " from #{a.first[:time]} to #{a.last[:time]}, " if a.size > 0
|
44
|
-
puts "Imported #{a.size} coords,#{time_substring}#{error_count} errors from file #{path}"
|
45
|
-
@coords += a
|
46
|
-
end
|
47
|
-
|
48
|
-
def self.proc_time(ts, time_offset = 0)
|
49
|
-
if ts =~ /(\d{4})-(\d{2})-(\d{2})T(\d{1,2}):(\d{2}):(\d{2})Z/
|
50
|
-
return Time.gm($1.to_i, $2.to_i, $3.to_i, $4.to_i, $5.to_i, $6.to_i).localtime + time_offset
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
def proc_time(ts, time_offset)
|
55
|
-
self.class.proc_time(ts, time_offset)
|
56
|
-
end
|
57
|
-
|
58
|
-
def find_by_time(time)
|
59
|
-
selected_coords = @coords.select { |c| (c[:time].localtime - time.localtime).abs < THRESHOLD }
|
60
|
-
selected_coords = selected_coords.sort { |a, b| (a[:time].localtime - time.localtime).abs <=> (b[:time].localtime - time.localtime).abs }
|
61
|
-
puts " - found #{selected_coords.size} coords within #{THRESHOLD}s from image time"
|
62
|
-
if selected_coords.size > 0
|
63
|
-
puts " - best is #{selected_coords.first[:time].localtime}, time offset #{selected_coords.first[:time].localtime - time.localtime}"
|
64
|
-
puts " - lat #{selected_coords.first[:lat]} lon #{selected_coords.first[:lon]}"
|
65
|
-
end
|
66
|
-
|
67
|
-
return selected_coords.first
|
68
|
-
end
|
69
|
-
|
70
|
-
end
|
71
|
-
end
|