Class: Tiler

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/tiler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_latObject

Returns the value of attribute end_lat.



12
13
14
# File 'lib/tiler.rb', line 12

def end_lat
  @end_lat
end

#end_lonObject

Returns the value of attribute end_lon.



12
13
14
# File 'lib/tiler.rb', line 12

def end_lon
  @end_lon
end

#end_xObject

Returns the value of attribute end_x.



12
13
14
# File 'lib/tiler.rb', line 12

def end_x
  @end_x
end

#end_yObject

Returns the value of attribute end_y.



12
13
14
# File 'lib/tiler.rb', line 12

def end_y
  @end_y
end

#outputObject

Returns the value of attribute output.



12
13
14
# File 'lib/tiler.rb', line 12

def output
  @output
end

#sourceObject

Returns the value of attribute source.



12
13
14
# File 'lib/tiler.rb', line 12

def source
  @source
end

#start_latObject

Returns the value of attribute start_lat.



12
13
14
# File 'lib/tiler.rb', line 12

def start_lat
  @start_lat
end

#start_lonObject

Returns the value of attribute start_lon.



12
13
14
# File 'lib/tiler.rb', line 12

def start_lon
  @start_lon
end

#start_xObject

Returns the value of attribute start_x.



12
13
14
# File 'lib/tiler.rb', line 12

def start_x
  @start_x
end

#start_yObject

Returns the value of attribute start_y.



12
13
14
# File 'lib/tiler.rb', line 12

def start_y
  @start_y
end

#zoomObject

Returns the value of attribute zoom.



12
13
14
# File 'lib/tiler.rb', line 12

def zoom
  @zoom
end

Instance Method Details

#defaultsObject



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

#runObject



47
48
49
50
51
# File 'lib/tiler.rb', line 47

def run
  download
  stitch
  cleanup
end

#tilesObject



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