module FFI::GDAL

Constants

VERSION

Public Class Methods

_file_with_constants(file_name) click to toggle source

Locates one of the files that has constants.

@return [String] Full path to file_name.

# File lib/ffi/gdal.rb, line 57
def self._file_with_constants(file_name)
  _files_with_constants.find { |f| f.end_with?(file_name) }
end
_files_with_constants() click to toggle source

@return [Array<String>] Related files that contain C constants.

# File lib/ffi/gdal.rb, line 37
def self._files_with_constants
  header_files = %w[
    cpl_conv.h cpl_error.h cpl_port.h cpl_string.h cpl_vsi.h
    gdal.h gdal_alg.h gdal_vrt.h gdalwarper.h
    ogr_core.h ogr_srs_api.h
  ]

  header_search_paths = %w[/usr/local/include /usr/include /usr/include/gdal /opt/homebrew/include/]

  header_files.map do |file|
    dir = header_search_paths.find do |d|
      File.exist?("#{d}/#{file}")
    end
    dir ? "#{dir}/#{file}" : nil
  end.compact
end
gdal_library_path() click to toggle source

@return [String]

# File lib/ffi/gdal.rb, line 32
def self.gdal_library_path
  @gdal_library_path ||= ENV.fetch("GDAL_LIBRARY_PATH", "gdal")
end