Class: OGR::Writer
Constant Summary
Constants included from FFIOGR
Instance Attribute Summary collapse
-
#ptr ⇒ Object
Returns the value of attribute ptr.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(driver_name) ⇒ Writer
constructor
A new instance of Writer.
- #set_output(path, options = {}) ⇒ Object
Methods included from FFIOGR
find_lib, gdal_library_path, search_paths
Constructor Details
#initialize(driver_name) ⇒ Writer
Returns a new instance of Writer.
7 8 9 10 11 12 |
# File 'lib/ffi-ogr/writer.rb', line 7 def initialize(driver_name) OGRRegisterAll() @driver = OGRGetDriverByName(driver_name) raise RuntimeError.new "Invalid driver name" if @driver.null? @type = driver_name end |
Instance Attribute Details
#ptr ⇒ Object
Returns the value of attribute ptr.
5 6 7 |
# File 'lib/ffi-ogr/writer.rb', line 5 def ptr @ptr end |
#type ⇒ Object
Returns the value of attribute type.
5 6 7 |
# File 'lib/ffi-ogr/writer.rb', line 5 def type @type end |
Instance Method Details
#set_output(path, options = {}) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/ffi-ogr/writer.rb', line 14 def set_output(path, ={}) path = File.(path) ds = OGR_Dr_CreateDataSource(@driver, path, nil) @ptr = OGR::Tools.cast_data_source(ds) @ptr end |