Class: GeoWorks::Derivatives::Processors::Raster::Processor

Inherits:
Hydra::Derivatives::Processors::Processor
  • Object
show all
Defined in:
lib/geo_works/derivatives/processors/raster.rb

Instance Method Summary collapse

Instance Method Details

#processObject



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

def process
  raster_processor_class.new(source_path,
                             directives,
                             output_file_service: output_file_service).process
end

#raster_processor_classObject

Returns a raster processor class based on mime type passed in the directives object.

Returns:

  • raster processing class



20
21
22
23
24
25
26
27
28
29
# File 'lib/geo_works/derivatives/processors/raster.rb', line 20

def raster_processor_class
  case directives.fetch(:input_format)
  when 'text/plain; gdal-format=USGSDEM'
    GeoWorks::Derivatives::Processors::Raster::Dem
  when 'application/octet-stream; gdal-format=AIG'
    GeoWorks::Derivatives::Processors::Raster::Aig
  else
    GeoWorks::Derivatives::Processors::Raster::Base
  end
end