Class: Tiler
Instance Attribute Summary collapse
-
#end_lat ⇒ Object
Returns the value of attribute end_lat.
-
#end_lon ⇒ Object
Returns the value of attribute end_lon.
-
#end_x ⇒ Object
Returns the value of attribute end_x.
-
#end_y ⇒ Object
Returns the value of attribute end_y.
-
#output ⇒ Object
Returns the value of attribute output.
-
#source ⇒ Object
Returns the value of attribute source.
-
#start_lat ⇒ Object
Returns the value of attribute start_lat.
-
#start_lon ⇒ Object
Returns the value of attribute start_lon.
-
#start_x ⇒ Object
Returns the value of attribute start_x.
-
#start_y ⇒ Object
Returns the value of attribute start_y.
-
#zoom ⇒ Object
Returns the value of attribute zoom.
Instance Method Summary collapse
- #defaults ⇒ Object
-
#initialize(args = {}) ⇒ Tiler
constructor
A new instance of Tiler.
- #run ⇒ Object
- #tiles ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ Tiler
Returns a new instance of Tiler.
30 31 32 33 34 35 36 37 |
# File 'lib/tiler.rb', line 30 def initialize(args = {}) set_rectangle(args) args = defaults.merge(args) self.zoom = args[:zoom] self.source = args[:source] self.output = args[:output] end |
Instance Attribute Details
#end_lat ⇒ Object
Returns the value of attribute end_lat.
12 13 14 |
# File 'lib/tiler.rb', line 12 def end_lat @end_lat end |
#end_lon ⇒ Object
Returns the value of attribute end_lon.
12 13 14 |
# File 'lib/tiler.rb', line 12 def end_lon @end_lon end |
#end_x ⇒ Object
Returns the value of attribute end_x.
12 13 14 |
# File 'lib/tiler.rb', line 12 def end_x @end_x end |
#end_y ⇒ Object
Returns the value of attribute end_y.
12 13 14 |
# File 'lib/tiler.rb', line 12 def end_y @end_y end |
#output ⇒ Object
Returns the value of attribute output.
12 13 14 |
# File 'lib/tiler.rb', line 12 def output @output end |
#source ⇒ Object
Returns the value of attribute source.
12 13 14 |
# File 'lib/tiler.rb', line 12 def source @source end |
#start_lat ⇒ Object
Returns the value of attribute start_lat.
12 13 14 |
# File 'lib/tiler.rb', line 12 def start_lat @start_lat end |
#start_lon ⇒ Object
Returns the value of attribute start_lon.
12 13 14 |
# File 'lib/tiler.rb', line 12 def start_lon @start_lon end |
#start_x ⇒ Object
Returns the value of attribute start_x.
12 13 14 |
# File 'lib/tiler.rb', line 12 def start_x @start_x end |
#start_y ⇒ Object
Returns the value of attribute start_y.
12 13 14 |
# File 'lib/tiler.rb', line 12 def start_y @start_y end |
#zoom ⇒ Object
Returns the value of attribute zoom.
12 13 14 |
# File 'lib/tiler.rb', line 12 def zoom @zoom end |
Instance Method Details
#defaults ⇒ Object
39 40 41 |
# File 'lib/tiler.rb', line 39 def defaults { zoom: 1, source: "sattelite", start_x: 0, start_y: 0, end_x: 0, end_y: 0} end |
#run ⇒ Object
47 48 49 50 51 |
# File 'lib/tiler.rb', line 47 def run download stitch cleanup end |
#tiles ⇒ Object
43 44 45 |
# File 'lib/tiler.rb', line 43 def tiles @tiles ||= TilesCollection.new(zoom: zoom, source: source, start_x: start_x, start_y: start_y, end_x: end_x, end_y: end_y, output: output) end |