gpx2exif 0.1.0 → 0.1.1

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/README.md CHANGED
@@ -78,7 +78,7 @@ How to use it
78
78
 
79
79
  2. Run command.
80
80
 
81
- gpx2png -g <input GPX file> -s <image size, format: WIDTHxHEIGHT> -o <output PPNG file>
81
+ gpx2png -g [input GPX file] -s [image size, format: WIDTHxHEIGHT] -o [output PPNG file]
82
82
 
83
83
  Example:
84
84
 
@@ -86,12 +86,14 @@ How to use it
86
86
 
87
87
  3. You can specify zoom.
88
88
 
89
- gpx2png -g <input GPX file> -z <zoom, best results if between 9 and 15, max 18> -o <output PPNG file>
89
+ gpx2png -g [input GPX file] -z [zoom, best results between 9 and 15, max 18] -o [output PPNG file]
90
90
 
91
91
  Example:
92
92
 
93
93
  gpx2png -g spec/fixtures/sample.gpx -z 11 -o map.png
94
94
 
95
+ 4. Adding -u forces using [UMP tiles](http://ump.waw.pl/) .
96
+
95
97
 
96
98
  Contributing to gpx2xif
97
99
  -------------------------------
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -3,6 +3,7 @@
3
3
  require 'rubygems'
4
4
  require 'gpx2exif'
5
5
  require 'gpx2png/osm'
6
+ require 'gpx2png/ump'
6
7
  require 'optparse'
7
8
 
8
9
  options = { }
@@ -21,6 +22,9 @@ OptionParser.new do |opts|
21
22
  opts.on("-o", "--output FILE", "Output image file") do |v|
22
23
  options[:output_file] = v
23
24
  end
25
+ opts.on("-u", "--ump", "Use UMP tiles rather than OSM") do
26
+ options[:ump] = true
27
+ end
24
28
  end.parse!
25
29
 
26
30
  unless options[:gpx]
@@ -40,7 +44,11 @@ unless @fail
40
44
  g = GpxUtils::TrackImporter.new
41
45
  g.add_file(options[:gpx])
42
46
 
43
- e = Gpx2png::Osm.new
47
+ if options[:ump]
48
+ e = Gpx2png::Ump.new
49
+ else
50
+ e = Gpx2png::Osm.new
51
+ end
44
52
  e.coords = g.coords
45
53
 
46
54
  if options[:size]
@@ -54,4 +62,7 @@ unless @fail
54
62
  end
55
63
 
56
64
  e.save(options[:output_file])
57
- end
65
+ end
66
+
67
+ # testing
68
+ # ruby -Ilib bin/gpx2png -g spec/fixtures/sample.gpx -s 400x400 -o samples/tmp/cli_test.png -u
@@ -42,6 +42,7 @@ module Gpx2png
42
42
  when :rmagick
43
43
  require 'gpx2png/renderers/rmagick_renderer'
44
44
  @r = RmagickRenderer.new(@renderer_options)
45
+ @r.licence_string = self.class.licence_string
45
46
  else
46
47
  raise ArgumentError
47
48
  end
@@ -276,5 +276,9 @@ module Gpx2png
276
276
  # TODO expand min and max ranges
277
277
  end
278
278
 
279
+ def self.licence_string
280
+ "Map data OpenStreetMap (CC-by-SA 2.0)"
281
+ end
282
+
279
283
  end
280
284
  end
@@ -11,7 +11,6 @@ module Gpx2png
11
11
  @width = @options[:width] || 3
12
12
  @aa = @options[:aa] == true
13
13
  @opacity = @options[:opacity] || 1.0
14
- @licence_string = "Map data OpenStreetMap (CC-by-SA 2.0)"
15
14
  @crop_margin = @options[:crop_margin] || 50
16
15
  @crop_enabled = @options[:crop_enabled] == true
17
16
 
@@ -26,10 +25,11 @@ module Gpx2png
26
25
  @licence_text.font_family('helvetica')
27
26
  @licence_text.font_style(Magick::NormalStyle)
28
27
  @licence_text.text_align(Magick::RightAlign)
29
- @licence_text.pointsize(10)
28
+ @licence_text.pointsize(12)
30
29
  end
31
30
 
32
31
  attr_accessor :x, :y
32
+ attr_accessor :licence_string
33
33
 
34
34
  # Create new (full) image
35
35
  def new_image
@@ -0,0 +1,21 @@
1
+ require 'rubygems'
2
+ require 'gpx2png/osm'
3
+
4
+ $:.unshift(File.dirname(__FILE__))
5
+
6
+ module Gpx2png
7
+ class Ump < Osm
8
+
9
+ # Convert OSM/UMP tile coords to url
10
+ def self.url(zoom, coord, server = '3.')
11
+ x, y = coord
12
+ url = "http://#{server}tiles.ump.waw.pl/ump_tiles/#{zoom}/#{x}/#{y}.png"
13
+ return url
14
+ end
15
+
16
+ def self.licence_string
17
+ "Data by UMP-pcPL+SRTM"
18
+ end
19
+
20
+ end
21
+ end
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.1.0
4
+ version: 0.1.1
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-07-22 00:00:00.000000000Z
12
+ date: 2012-08-06 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
16
- requirement: &18503860 !ruby/object:Gem::Requirement
16
+ requirement: &19750200 !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: *18503860
24
+ version_requirements: *19750200
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: mini_exiftool
27
- requirement: &18503360 !ruby/object:Gem::Requirement
27
+ requirement: &19749640 !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: *18503360
35
+ version_requirements: *19749640
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: builder
38
- requirement: &18502800 !ruby/object:Gem::Requirement
38
+ requirement: &19749100 !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: *18502800
46
+ version_requirements: *19749100
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec
49
- requirement: &18502280 !ruby/object:Gem::Requirement
49
+ requirement: &19748580 !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: *18502280
57
+ version_requirements: *19748580
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: bundler
60
- requirement: &18501740 !ruby/object:Gem::Requirement
60
+ requirement: &19748100 !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: *18501740
68
+ version_requirements: *19748100
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: jeweler
71
- requirement: &18501240 !ruby/object:Gem::Requirement
71
+ requirement: &19747620 !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: *18501240
79
+ version_requirements: *19747620
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: simplecov
82
- requirement: &18500760 !ruby/object:Gem::Requirement
82
+ requirement: &19747100 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,7 +87,7 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *18500760
90
+ version_requirements: *19747100
91
91
  description: Mass geotagger using GPX files.
92
92
  email: bobikx@poczta.fm
93
93
  executables:
@@ -121,6 +121,7 @@ files:
121
121
  - lib/gpx2png/osm_base.rb
122
122
  - lib/gpx2png/renderers/chunky_png_renderer.rb
123
123
  - lib/gpx2png/renderers/rmagick_renderer.rb
124
+ - lib/gpx2png/ump.rb
124
125
  - lib/gpx_utils.rb
125
126
  - lib/gpx_utils/track_importer.rb
126
127
  - lib/gpx_utils/waypoints_exporter.rb
@@ -141,7 +142,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
141
142
  version: '0'
142
143
  segments:
143
144
  - 0
144
- hash: -1457558773610326867
145
+ hash: -3598611687449756095
145
146
  required_rubygems_version: !ruby/object:Gem::Requirement
146
147
  none: false
147
148
  requirements: