Class: GeoConcerns::Processors::Vector::Base

Inherits:
Hydra::Derivatives::Processors::Processor
  • Object
show all
Includes:
BaseGeoProcessor, Gdal, Image, Ogr, Rendering, Zip, Hydra::Derivatives::Processors::ShellBasedProcessor
Defined in:
app/processors/geo_concerns/processors/vector/base.rb

Direct Known Subclasses

Shapefile

Class Method Summary collapse

Methods included from Rendering

simple_tiles_map

Methods included from BaseGeoProcessor

#basename, #id, #label, #options_for, #output_size, #output_srid

Class Method Details

.encode(path, options, output_file) ⇒ Object



13
14
15
16
17
18
19
20
# File 'app/processors/geo_concerns/processors/vector/base.rb', line 13

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

.encode_queueArray

Set of commands to run to encode the vector thumbnail.

Returns:

  • (Array)

    set of command name symbols



24
25
26
# File 'app/processors/geo_concerns/processors/vector/base.rb', line 24

def self.encode_queue
  [:reproject, :vector_thumbnail, :trim, :center]
end

.encode_vector(in_path, out_path, options) ⇒ Object



34
35
36
# File 'app/processors/geo_concerns/processors/vector/base.rb', line 34

def self.encode_vector(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 vector.

Returns:

  • (Array)

    set of command name symbols



30
31
32
# File 'app/processors/geo_concerns/processors/vector/base.rb', line 30

def self.reproject_queue
  [:reproject, :zip]
end

.reproject_vector(in_path, out_path, options) ⇒ Object



38
39
40
# File 'app/processors/geo_concerns/processors/vector/base.rb', line 38

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