Class: GDAL::Gridder
- Inherits:
-
Object
- Object
- GDAL::Gridder
- Includes:
- PointExtracting, Logger
- Defined in:
- lib/gdal/extensions/gridder.rb,
lib/gdal/extensions/gridder/point_extracting.rb
Overview
Somewhat analogous to the gdal_grid utility.
Defined Under Namespace
Modules: PointExtracting
Constant Summary collapse
- DESIRED_BUFFER_SIZE =
16 * 1024 * 1024
Instance Attribute Summary collapse
-
#grid ⇒ GDAL::Grid
readonly
Object used by for doing the actual grid work.
Instance Method Summary collapse
-
#grid! ⇒ Object
Does all of the things: gathers points from the associated Layer, processes the points according to associated GridderOptions, grids the points, and writes out the newly gridder raster.
-
#initialize(source_layer, dest_file_name, gridder_options, points: nil) ⇒ Gridder
constructor
A new instance of Gridder.
Methods included from PointExtracting
Constructor Details
#initialize(source_layer, dest_file_name, gridder_options, points: nil) ⇒ Gridder
Returns a new instance of Gridder.
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/gdal/extensions/gridder.rb', line 36 def initialize(source_layer, dest_file_name, , points: nil) @source_layer = source_layer @dest_file_name = dest_file_name @options = @points = points @x_min = nil @x_max = nil @y_min = nil @y_max = nil end |
Instance Attribute Details
#grid ⇒ GDAL::Grid (readonly)
Object used by for doing the actual grid work.
26 27 28 |
# File 'lib/gdal/extensions/gridder.rb', line 26 def grid @grid end |
Instance Method Details
#grid! ⇒ Object
Does all of the things: gathers points from the associated Layer, processes the points according to associated GridderOptions, grids the points, and writes out the newly gridder raster.
51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/gdal/extensions/gridder.rb', line 51 def grid! dataset = build_dataset(@options.output_driver, @dest_file_name, @options.output_data_type, @options.) grid_and_write(dataset.raster_band(1), dataset.geo_transform) if @options.[:no_data_value] dataset.raster_band(1).no_data_value = @options.[:no_data_value] end dataset.close end |