Class: GeoConcerns::Processors::Raster::Processor

Inherits:
Hydra::Derivatives::Processors::Processor
  • Object
show all
Defined in:
app/processors/geo_concerns/processors/raster.rb

Instance Method Summary collapse

Instance Method Details

#processObject



5
6
7
8
9
# File 'app/processors/geo_concerns/processors/raster.rb', line 5

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



13
14
15
16
17
18
19
20
21
22
# File 'app/processors/geo_concerns/processors/raster.rb', line 13

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