module GDAL

Constants

FFI_GDAL_ERROR_HANDLER

We define our own error handler so we can turn GDAL errors into Ruby exceptions.

Attributes

c_struct[R]

@return [FFI::GDAL::RPCInfo]

Public Class Methods

simple_progress_formatter() click to toggle source

Use when you want something quick and easy for when you need something quick for a FFI::GDAL::GDALProgressFunc. Outputs the duration and percentage completed.

@return [Proc] A Proc that works for a GDALProgressFunc callback.

# File lib/gdal.rb, line 13
def simple_progress_formatter
  start = Time.now

  lambda do |d, _, _|
    print "Duration: #{(Time.now - start).to_f.round(2)}s\t| #{(d * 100).round(2)}%\r"
    true
  end
end

Private Class Methods

gdal_require(path) click to toggle source
# File lib/gdal.rb, line 24
def gdal_require(path)
  File.expand_path(path, __dir__)
end