class OGR::Reader
Constants
- TF_MAP
Attributes
type[RW]
Public Class Methods
new(driver_name)
click to toggle source
# File lib/ffi-ogr/reader.rb, line 14 def initialize(driver_name) OGRRegisterAll() @driver = OGRGetDriverByName(driver_name) raise RuntimeError.new "Invalid driver name" if @driver.null? @type = driver_name end
Public Instance Methods
read(file_path, writeable=false)
click to toggle source
# File lib/ffi-ogr/reader.rb, line 21 def read(file_path, writeable=false) ds = OGR_Dr_Open(@driver, File.expand_path(file_path), TF_MAP[writeable]) OGR::Tools.cast_data_source(ds) end