Sha256: 5cc32d1e0900edeb725c3b2bbc0b53fe14cc6cd720124aa21b46de751d9faf93

Contents?: true

Size: 516 Bytes

Versions: 8

Compression:

Stored size: 516 Bytes

Contents

# frozen_string_literal: true

class Map::Gdal::MergeService
  include Map::Gdal::Base

  def initialize(files)
    raise 'Files is not an array' unless files.is_a?(Array)
    @files = files
  end

  def call(options = [])
    files = @files.select{ |file| file.downcase[/(.jp2|.tif)$/, 1].present? }.join(' ')
    out = get_path_to_temp_file('merge', 'tif')

    run_command("gdal_merge.py #{options.join(' ')} #{files} -o #{out}")

    add_to_clean(out)
    add_to_clean(out.gsub('tif', 'tfw'))

    out
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
aqila-mapas-0.4.12 lib/map/gdal/merge_service.rb
aqila-mapas-0.4.11 lib/map/gdal/merge_service.rb
aqila-mapas-0.4.9 lib/map/gdal/merge_service.rb
aqila-mapas-0.4.8 lib/map/gdal/merge_service.rb
aqila-mapas-0.4.7 lib/map/gdal/merge_service.rb
aqila-mapas-0.4.6 lib/map/gdal/merge_service.rb
aqila-mapas-0.4.5 lib/map/gdal/merge_service.rb
aqila-mapas-0.4.4 lib/map/gdal/merge_service.rb