Class: GeoConcerns::Processors::Raster::Aig
- Inherits:
-
Base
- Object
- Hydra::Derivatives::Processors::Processor
- Base
- GeoConcerns::Processors::Raster::Aig
- Includes:
- Zip
- Defined in:
- app/processors/geo_concerns/processors/raster/aig.rb
Class Method Summary collapse
- .encode(path, options, output_file) ⇒ Object
-
.reproject_queue ⇒ Array
Set of commands to run to reproject the AIG.
-
.translate(in_path, out_path, options) ⇒ Object
Executes a gdal_translate command to translate a raster format into a different format with a scaling options.
Methods inherited from Base
encode_queue, encode_raster, reproject_raster
Methods included from BaseGeoProcessor
#basename, #id, #label, #options_for, #output_size, #output_srid
Class Method Details
.encode(path, options, output_file) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/processors/geo_concerns/processors/raster/aig.rb', line 7 def self.encode(path, , output_file) unzip(path, output_file) do |zip_path| info = Info.new(zip_path) [:min_max] = info.min_max case [:label] when :thumbnail encode_raster(zip_path, output_file, ) when :display_raster reproject_raster(zip_path, output_file, ) end end end |
.reproject_queue ⇒ Array
Set of commands to run to reproject the AIG.
22 23 24 |
# File 'app/processors/geo_concerns/processors/raster/aig.rb', line 22 def self.reproject_queue [:warp, :translate] end |
.translate(in_path, out_path, options) ⇒ Object
Executes a gdal_translate command to translate a raster format into a different format with a scaling options. This command scales the min and max values of the raster into the 0 to 255 range. Scale is inverted (255 to 0) to create a better visualization.
33 34 35 36 |
# File 'app/processors/geo_concerns/processors/raster/aig.rb', line 33 def self.translate(in_path, out_path, ) execute "gdal_translate -scale #{[:min_max]} 255 0 "\ "-q -ot Byte -of GTiff \"#{in_path}\" #{out_path}" end |