Sha256: 513c6311de98a830efbb2396a974429b2c7726e92fee1255d2f2c0c7ff0db730

Contents?: true

Size: 1.23 KB

Versions: 9

Compression:

Stored size: 1.23 KB

Contents

module GeoConcerns
  module Processors
    module Raster
      class Base < Hydra::Derivatives::Processors::Processor
        include Hydra::Derivatives::Processors::ShellBasedProcessor
        include GeoConcerns::Processors::BaseGeoProcessor
        include GeoConcerns::Processors::Gdal

        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

        # Set of commands to run to encode the raster thumbnail.
        # @return [Array] set of command name symbols
        def self.encode_queue
          [:translate, :convert]
        end

        # Set of commands to run to reproject the raster.
        # @return [Array] set of command name symbols
        def self.reproject_queue
          [:warp, :compress]
        end

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

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

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
geo_concerns-0.0.10 app/processors/geo_concerns/processors/raster/base.rb
geo_concerns-0.0.9 app/processors/geo_concerns/processors/raster/base.rb
geo_concerns-0.0.8 app/processors/geo_concerns/processors/raster/base.rb
geo_concerns-0.0.7 app/processors/geo_concerns/processors/raster/base.rb
geo_concerns-0.0.6 app/processors/geo_concerns/processors/raster/base.rb
geo_concerns-0.0.5 app/processors/geo_concerns/processors/raster/base.rb
geo_concerns-0.0.4 app/processors/geo_concerns/processors/raster/base.rb
geo_concerns-0.0.3 app/processors/geo_concerns/processors/raster/base.rb
geo_concerns-0.0.2 app/processors/geo_concerns/processors/raster/base.rb