Class: GeoConcerns::Processors::Raster::Base

Inherits:
Hydra::Derivatives::Processors::Processor
  • Object
show all
Includes:
BaseGeoProcessor, Gdal, Image, Hydra::Derivatives::Processors::ShellBasedProcessor
Defined in:
app/processors/geo_concerns/processors/raster/base.rb

Direct Known Subclasses

Aig, Dem

Class Method Summary collapse

Methods included from BaseGeoProcessor

#basename, #id, #label, #options_for, #output_size, #output_srid

Class Method Details

.encode(path, options, output_file) ⇒ Object



10
11
12
13
14
15
16
17
# File 'app/processors/geo_concerns/processors/raster/base.rb', line 10

def self.encode(path, options, output_file)
  case options[:label]
  when :thumbnail
    encode_raster(path, output_file, options)
  when :display_raster
    reproject_raster(path, output_file, options)
  end
end

.encode_queueArray

Set of commands to run to encode the raster thumbnail.

Returns:

  • (Array)

    set of command name symbols



21
22
23
# File 'app/processors/geo_concerns/processors/raster/base.rb', line 21

def self.encode_queue
  [:translate, :convert]
end

.encode_raster(in_path, out_path, options) ⇒ Object



31
32
33
# File 'app/processors/geo_concerns/processors/raster/base.rb', line 31

def self.encode_raster(in_path, out_path, options)
  run_commands(in_path, out_path, encode_queue, options)
end

.reproject_queueArray

Set of commands to run to reproject the raster.

Returns:

  • (Array)

    set of command name symbols



27
28
29
# File 'app/processors/geo_concerns/processors/raster/base.rb', line 27

def self.reproject_queue
  [:warp, :compress]
end

.reproject_raster(in_path, out_path, options) ⇒ Object



35
36
37
# File 'app/processors/geo_concerns/processors/raster/base.rb', line 35

def self.reproject_raster(in_path, out_path, options)
  run_commands(in_path, out_path, reproject_queue, options)
end