Sha256: b3ba56fd48ff1745c95316a1e8bc0a2747e7b63baf95733b40ca4cc2a87268f0

Contents?: true

Size: 829 Bytes

Versions: 2

Compression:

Stored size: 829 Bytes

Contents

require_relative '../../ffi/gdal/matching'

module GDAL
  module DatasetMixins
    module Matching
      # @param other_dataset [GDAL::Dataset]
      # @param options [Hash]
      # @return [Hash{count => Fixnum, gcp: => FFI::GDAL::GCP}] Not sure why,
      #   but the C function seems to return a single GCP instead of an Array of
      #   them.
      def compute_matching_points(other_dataset, **options)
        other_dataset_ptr = GDAL._pointer(GDAL::Dataset, other_dataset)
        options_ptr = GDAL::Options.pointer(options)
        gcp_count_ptr = FFI::MemoryPointer.new(:int)

        gcp = FFI::GDAL::Matching.GDALComputeMatchingPoints(
          @c_pointer,
          other_dataset_ptr,
          options_ptr,
          gcp_count_ptr)

        { count: gcp_count_ptr.read_int, gcp: gcp }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ffi-gdal-1.0.0.beta5 lib/gdal/dataset_mixins/matching.rb
ffi-gdal-1.0.0.beta4 lib/gdal/dataset_mixins/matching.rb