Class: GDAL::GridderOptions
- Inherits:
-
Object
- Object
- GDAL::GridderOptions
- Extended by:
- Forwardable
- Defined in:
- lib/gdal/extensions/gridder_options.rb
Overview
Object to be used with a Gridder.
Instance Attribute Summary collapse
-
#grid ⇒ GDAL::Grid
readonly
Object used by the Gridder for doing the actual grid work.
-
#input_clipping_geometry ⇒ OGR::Geometry
Use for filtering out input points; any input points from the layer that fall within this boundary will be excluded from the gridding process.
-
#input_field_name ⇒ String
Name of field attribute to extract from each feature to use for Z values.
-
#output_creation_options ⇒ Hash
Driver-specific options to pass to the Driver when creating the raster.
-
#output_data_type ⇒ FFI::GDAL::GDAL::DataType
Data type of the output raster values.
-
#output_format ⇒ String
The Driver name to use for creating the output raster.
-
#output_projection ⇒ OGR::SpatialReference
The SpatialReference to use for the output raster’s Dataset#projection.
-
#output_size ⇒ Hash{width: Number, height: Number}
Dimensions to output the raster in.
-
#output_x_extent ⇒ Hash{min: Number, max: Number}
The minimum and maximum X coordinates for the output raster.
-
#output_y_extent ⇒ Hash{min: Number, max: Number}
The minimum and maximum Y coordinates for the output raster.
-
#progress_formatter ⇒ Proc
Custom progress output Proc, passed on to GDAL::Grid#create.
Instance Method Summary collapse
-
#algorithm_options ⇒ FFI::Struct
Object used by the Gridder for doing the actual grid work.
-
#initialize(algorithm_type) ⇒ GridderOptions
constructor
A new instance of GridderOptions.
- #output_data_type_size ⇒ Integer
-
#output_driver ⇒ GDAL::Driver
The Driver, based on #output_format to use for creating the output raster.
Constructor Details
#initialize(algorithm_type) ⇒ GridderOptions
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/gdal/extensions/gridder_options.rb', line 123 def initialize(algorithm_type) # Options with defaults @output_data_type = :GDT_Float64 @output_format = "GTiff" @output_size = { width: 256, height: 256 } # Options without defaults @input_clipping_geometry = nil @output_x_extent = {} @output_y_extent = {} @output_projection = nil @output_creation_options = {} @progress_formatter = nil @grid = GDAL::Grid.new(algorithm_type, data_type: @output_data_type) end |
Instance Attribute Details
#grid ⇒ GDAL::Grid (readonly)
Object used by the GDAL::Gridder for doing the actual grid work.
114 115 116 |
# File 'lib/gdal/extensions/gridder_options.rb', line 114 def grid @grid end |
#input_clipping_geometry ⇒ OGR::Geometry
Use for filtering out input points; any input points from the layer that fall within this boundary will be excluded from the gridding process. Note that this does not clip the output raster.
Replaces gdal_grid’s -clipsrc
option.
38 39 40 |
# File 'lib/gdal/extensions/gridder_options.rb', line 38 def input_clipping_geometry @input_clipping_geometry end |
#input_field_name ⇒ String
Name of field attribute to extract from each feature to use for Z values.
18 19 20 |
# File 'lib/gdal/extensions/gridder_options.rb', line 18 def input_field_name @input_field_name end |
#output_creation_options ⇒ Hash
Driver-specific options to pass to the Driver when creating the raster. Check out GDAL documentation for the driver you’re specifying (specified here through #output_format) to see what options you have available.
Correlates to gdal_grid option -co
.
49 50 51 |
# File 'lib/gdal/extensions/gridder_options.rb', line 49 def @output_creation_options end |
#output_data_type ⇒ FFI::GDAL::GDAL::DataType
Data type of the output raster values.
Correlates to gdal_grid option -ot
.
108 109 110 |
# File 'lib/gdal/extensions/gridder_options.rb', line 108 def output_data_type @output_data_type end |
#output_format ⇒ String
The Driver name to use for creating the output raster.
Correlates to gdal_grid option -of
.
57 58 59 |
# File 'lib/gdal/extensions/gridder_options.rb', line 57 def output_format @output_format end |
#output_projection ⇒ OGR::SpatialReference
The SpatialReference to use for the output raster’s Dataset#projection. If one isn’t given, the GDAL::Gridder will try to use the one from the source layer.
Correlates to gdal_grid option -a_srs
.
83 84 85 |
# File 'lib/gdal/extensions/gridder_options.rb', line 83 def output_projection @output_projection end |
#output_size ⇒ Hash{width: Number, height: Number} #output_size=(width_height_array) ⇒ Hash{width: Number, height: Number} #output_size=(width_height_hash) ⇒ Hash{width: Number, height: Number}
Dimensions to output the raster in.
Correlates to gdal_grid option -outsize
.
100 101 102 |
# File 'lib/gdal/extensions/gridder_options.rb', line 100 def output_size @output_size end |
#output_x_extent ⇒ Hash{min: Number, max: Number}
The minimum and maximum X coordinates for the output raster.
Correlates to gdal_grid option -txe
.
65 66 67 |
# File 'lib/gdal/extensions/gridder_options.rb', line 65 def output_x_extent @output_x_extent end |
#output_y_extent ⇒ Hash{min: Number, max: Number}
The minimum and maximum Y coordinates for the output raster.
Correlates to gdal_grid option -tye
.
73 74 75 |
# File 'lib/gdal/extensions/gridder_options.rb', line 73 def output_y_extent @output_y_extent end |
#progress_formatter ⇒ Proc
Custom progress output Proc, passed on to GDAL::Grid#create. This must follow semantics imposed by FFI::GDAL::GDAL.ProgressFunc
.
This option doesn’t exist in gdal_grid; you only get their output format or no output at all (using -q
).
28 29 30 |
# File 'lib/gdal/extensions/gridder_options.rb', line 28 def progress_formatter @progress_formatter end |
Instance Method Details
#algorithm_options ⇒ FFI::Struct
Object used by the GDAL::Gridder for doing the actual grid work.
120 |
# File 'lib/gdal/extensions/gridder_options.rb', line 120 def_delegator :@grid, :algorithm_options, :algorithm_options |
#output_data_type_size ⇒ Integer
163 164 165 |
# File 'lib/gdal/extensions/gridder_options.rb', line 163 def output_data_type_size GDAL::DataType.size(@output_data_type) / 8 end |
#output_driver ⇒ GDAL::Driver
The Driver, based on #output_format to use for creating the output raster.
182 183 184 |
# File 'lib/gdal/extensions/gridder_options.rb', line 182 def output_driver @output_driver ||= GDAL::Driver.by_name(@output_format) end |