Class: GeoWorks::Derivatives::Processors::Vector::Base

Inherits:
Hydra::Derivatives::Processors::Processor
  • Object
show all
Includes:
BaseGeoProcessor, Gdal, Image, Ogr, Rendering, Zip, Hydra::Derivatives::Processors::ShellBasedProcessor
Defined in:
lib/geo_works/derivatives/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



15
16
17
18
19
20
21
22
# File 'lib/geo_works/derivatives/processors/vector/base.rb', line 15

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



26
27
28
# File 'lib/geo_works/derivatives/processors/vector/base.rb', line 26

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

.encode_vector(in_path, out_path, options) ⇒ Object



36
37
38
# File 'lib/geo_works/derivatives/processors/vector/base.rb', line 36

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



32
33
34
# File 'lib/geo_works/derivatives/processors/vector/base.rb', line 32

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

.reproject_vector(in_path, out_path, options) ⇒ Object



40
41
42
# File 'lib/geo_works/derivatives/processors/vector/base.rb', line 40

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