Class: Map::Gdal::RgbService

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/map/gdal/rgb_service.rb

Instance Attribute Summary collapse

Attributes included from Base

#files_to_clean

Instance Method Summary collapse

Methods included from Base

#add_to_clean, #clean, #gdal_running?, #get_file_name_with_path, #get_layer_name, #get_path_to_temp_file, #options_to_command_line, #run_command, #store_kml, #tmp_file

Constructor Details

#initialize(files) ⇒ RgbService

Returns a new instance of RgbService.



10
11
12
# File 'lib/map/gdal/rgb_service.rb', line 10

def initialize(files)
  @merge = Map::Gdal::MergeService.new(files)
end

Instance Attribute Details

#mergeObject (readonly)

Returns the value of attribute merge.



6
7
8
# File 'lib/map/gdal/rgb_service.rb', line 6

def merge
  @merge
end

Instance Method Details

#callObject



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/map/gdal/rgb_service.rb', line 14

def call
  # http://www.processamentodigital.com.br/2013/11/23/qgis-2-0-composicao-colorida-rgb-para-imagens-landsat-8/

  out = @merge.call([
    '-separate',
    '-co TFW=yes',
    '-of GTiff'
  ])

  add_to_clean(out)

  out
end