Class: GDAL::Utils::DEM
- Inherits:
-
Object
- Object
- GDAL::Utils::DEM
- Defined in:
- lib/gdal/utils/dem.rb,
lib/gdal/utils/dem/options.rb
Overview
Wrapper for gdaldem using GDALDEMProcessing C API.
Defined Under Namespace
Classes: Options
Class Method Summary collapse
-
.perform(dst_dataset_path:, src_dataset:, processing:, color_filename: nil, options: Options.new) {|GDAL::Dataset| ... } ⇒ GDAL::Dataset
Perform the gdaldem (GDALDEMProcessing) operation.
Class Method Details
.perform(dst_dataset_path:, src_dataset:, processing:, color_filename: nil, options: Options.new) {|GDAL::Dataset| ... } ⇒ GDAL::Dataset
Perform the gdaldem (GDALDEMProcessing) operation.
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/gdal/utils/dem.rb', line 90 def self.perform(dst_dataset_path:, src_dataset:, processing:, color_filename: nil, options: Options.new, &block) result_code_ptr = ::FFI::MemoryPointer.new(:int) dst_dataset_ptr = ::FFI::GDAL::Utils.GDALDEMProcessing( dst_dataset_path, src_dataset.c_pointer, processing, color_filename, .c_pointer, result_code_ptr ) success = result_code_ptr.read_int.zero? raise ::GDAL::Error, "GDALDEMProcessing failed." if dst_dataset_ptr.null? || !success ::GDAL::Dataset.open(dst_dataset_ptr, "w", &block) end |