class GDAL::Transformers::GeolocationTransformer

Attributes

c_pointer[R]

@return [FFI::Pointer] C pointer to the C geolocation transformer.

Public Class Methods

function() click to toggle source

@return [FFI::Function]

# File lib/gdal/transformers/geolocation_transformer.rb, line 7
def self.function
  FFI::GDAL::Alg::GeoLocTransform
end
release(pointer) click to toggle source

@param pointer [FFI::Pointer]

# File lib/gdal/transformers/geolocation_transformer.rb, line 12
def self.release(pointer)
  return unless pointer && !pointer.null?

  FFI::GDAL::Alg.GDALDestroyGeoLocTransformer(pointer)
end

Public Instance Methods

destroy!() click to toggle source
# File lib/gdal/transformers/geolocation_transformer.rb, line 37
def destroy!
  GeolocationTransformer.release(@c_pointer)

  @c_pointer = nil
end
function() click to toggle source

@return [FFI::Function]

# File lib/gdal/transformers/geolocation_transformer.rb, line 44
def function
  self.class.function
end
intialize(base_dataset, geolocation_info, reversed: false) click to toggle source

@param base_dataset [GDAL::Dataset] @param geolocation_info [Array<String>] @param reversed [Boolean]

# File lib/gdal/transformers/geolocation_transformer.rb, line 24
def intialize(base_dataset, geolocation_info, reversed: false)
  base_dataset_ptr = GDAL._pointer(GDAL::Dataset, base_dataset)
  geolocation_info_ptr = GDAL._string_array_to_pointer(geolocation_info)

  pointer = FFI::GDAL::Alg.CreateGeoLocTransformer(
    base_dataset_ptr,
    geolocation_info_ptr,
    reversed
  )

  @c_pointer = FFI::AutoPointer.new(pointer, GeolocationTransformer.method(:release))
end