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 +4 -2
- data/VERSION +1 -1
- data/bin/gpx2png +13 -2
- data/lib/gpx2png/osm.rb +1 -0
- data/lib/gpx2png/osm_base.rb +4 -0
- data/lib/gpx2png/renderers/rmagick_renderer.rb +2 -2
- data/lib/gpx2png/ump.rb +21 -0
- metadata +18 -17
data/README.md
CHANGED
@@ -78,7 +78,7 @@ How to use it
|
|
78
78
|
|
79
79
|
2. Run command.
|
80
80
|
|
81
|
-
gpx2png -g
|
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
|
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.
|
1
|
+
0.1.1
|
data/bin/gpx2png
CHANGED
@@ -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
|
-
|
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
|
data/lib/gpx2png/osm.rb
CHANGED
data/lib/gpx2png/osm_base.rb
CHANGED
@@ -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(
|
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
|
data/lib/gpx2png/ump.rb
ADDED
@@ -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.
|
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-
|
12
|
+
date: 2012-08-06 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
16
|
-
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: *
|
24
|
+
version_requirements: *19750200
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: mini_exiftool
|
27
|
-
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: *
|
35
|
+
version_requirements: *19749640
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: builder
|
38
|
-
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: *
|
46
|
+
version_requirements: *19749100
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rspec
|
49
|
-
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: *
|
57
|
+
version_requirements: *19748580
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: bundler
|
60
|
-
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: *
|
68
|
+
version_requirements: *19748100
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: jeweler
|
71
|
-
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: *
|
79
|
+
version_requirements: *19747620
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: simplecov
|
82
|
-
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: *
|
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: -
|
145
|
+
hash: -3598611687449756095
|
145
146
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
146
147
|
none: false
|
147
148
|
requirements:
|