Class: Map::ShapeToTifService
- Inherits:
-
Object
- Object
- Map::ShapeToTifService
- Defined in:
- lib/map/shape_to_tif_service.rb
Overview
Converte um shape file para tif
-
Rasteriza o shape
-
Faz resample
-
Aplica escala de cores
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#shape_file ⇒ Object
readonly
Returns the value of attribute shape_file.
Instance Method Summary collapse
- #call(options) ⇒ Object
-
#initialize(shape_file) ⇒ ShapeToTifService
constructor
A new instance of ShapeToTifService.
Constructor Details
#initialize(shape_file) ⇒ ShapeToTifService
Returns a new instance of ShapeToTifService.
10 11 12 13 |
# File 'lib/map/shape_to_tif_service.rb', line 10 def initialize(shape_file) @shape_file = shape_file @services = [] end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
8 9 10 |
# File 'lib/map/shape_to_tif_service.rb', line 8 def @options end |
#shape_file ⇒ Object (readonly)
Returns the value of attribute shape_file.
8 9 10 |
# File 'lib/map/shape_to_tif_service.rb', line 8 def shape_file @shape_file end |
Instance Method Details
#call(options) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/map/shape_to_tif_service.rb', line 15 def call() @options = color_result = color crop_service = Map::Gdal::CropService.new(color_result[:file]) original_file = color_result[:file] color_result[:file] = crop_service.call({ reference: IO.read([:kml]), s_srs: 'WGS84' }) FileUtils.rm_rf(original_file) color_result ensure clean_services end |