Class: GeoWorks::Derivatives::Processors::Raster::Base

Inherits:
Hydra::Derivatives::Processors::Processor
  • Object
show all
Includes:
BaseGeoProcessor, Gdal, Image, Hydra::Derivatives::Processors::ShellBasedProcessor
Defined in:
lib/geo_works/derivatives/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



12
13
14
15
16
17
18
19
# File 'lib/geo_works/derivatives/processors/raster/base.rb', line 12

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



23
24
25
# File 'lib/geo_works/derivatives/processors/raster/base.rb', line 23

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

.encode_raster(in_path, out_path, options) ⇒ Object



33
34
35
# File 'lib/geo_works/derivatives/processors/raster/base.rb', line 33

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



29
30
31
# File 'lib/geo_works/derivatives/processors/raster/base.rb', line 29

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

.reproject_raster(in_path, out_path, options) ⇒ Object



37
38
39
# File 'lib/geo_works/derivatives/processors/raster/base.rb', line 37

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