Sha256: 853327a735299b87abd5b924b18ffaca99a95675d0bc5a5d6a0ee6794aad78a0

Contents?: true

Size: 1.44 KB

Versions: 8

Compression:

Stored size: 1.44 KB

Contents

module GeoConcerns
  module Processors
    module Vector
      class Base < Hydra::Derivatives::Processors::Processor
        include Hydra::Derivatives::Processors::ShellBasedProcessor
        include GeoConcerns::Processors::BaseGeoProcessor
        include GeoConcerns::Processors::Image
        include GeoConcerns::Processors::Ogr
        include GeoConcerns::Processors::Gdal
        include GeoConcerns::Processors::Rendering
        include GeoConcerns::Processors::Zip

        def self.encode(path, options, output_file)
          case options[:label]
          when :thumbnail
            encode_vector(path, output_file, options)
          when :display_vector
            reproject_vector(path, output_file, options)
          end
        end

        # Set of commands to run to encode the vector thumbnail.
        # @return [Array] set of command name symbols
        def self.encode_queue
          [:reproject, :vector_thumbnail, :trim, :center]
        end

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

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

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
geo_concerns-0.3.4 app/processors/geo_concerns/processors/vector/base.rb
geo_concerns-0.3.3 app/processors/geo_concerns/processors/vector/base.rb
geo_concerns-0.3.2 app/processors/geo_concerns/processors/vector/base.rb
geo_concerns-0.3.1 app/processors/geo_concerns/processors/vector/base.rb
geo_concerns-0.3.0 app/processors/geo_concerns/processors/vector/base.rb
geo_concerns-0.2.0 app/processors/geo_concerns/processors/vector/base.rb
geo_concerns-0.1.1 app/processors/geo_concerns/processors/vector/base.rb
geo_concerns-0.1.0 app/processors/geo_concerns/processors/vector/base.rb