Class: Map::Gdal::WarpService
- Inherits:
-
Object
- Object
- Map::Gdal::WarpService
- Includes:
- Base
- Defined in:
- lib/map/gdal/warp_service.rb
Overview
gdalwarp - image reprojection and warping utility www.gdal.org/gdalwarp.html
Instance Attribute Summary collapse
-
#tif ⇒ Object
readonly
Returns the value of attribute tif.
Attributes included from Base
Instance Method Summary collapse
- #call(options) ⇒ Object
-
#initialize(tif) ⇒ WarpService
constructor
A new instance of WarpService.
Methods included from Base
#add_to_clean, #clean, #gdal_running?, #get_file_name_with_path, #get_layer_name, #get_path_to_temp_file, #options_to_command_line, #run_command, #store_kml, #tmp_file
Constructor Details
#initialize(tif) ⇒ WarpService
Returns a new instance of WarpService.
9 10 11 |
# File 'lib/map/gdal/warp_service.rb', line 9 def initialize(tif) @tif = tif end |
Instance Attribute Details
#tif ⇒ Object (readonly)
Returns the value of attribute tif.
8 9 10 |
# File 'lib/map/gdal/warp_service.rb', line 8 def tif @tif end |
Instance Method Details
#call(options) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/map/gdal/warp_service.rb', line 13 def call() raise "Arquivo TIF inválido. [#{tif.inspect}]" unless tif && File.exist?(tif) out = get_path_to_temp_file(:warp, :tif) run_command(%{gdalwarp -q -overwrite #{()} "#{tif}" "#{out}"}) add_to_clean(out) out end |