module OGR::LayerMixins::OGRSQLMethods

Public Instance Methods

commit_transaction() click to toggle source

@raise [OGR::Failure]

# File lib/ogr/layer_mixins/ogr_sql_methods.rb, line 12
def commit_transaction
  transact { FFI::OGR::API.OGR_L_CommitTransaction(@c_pointer) }
end
fid_column() click to toggle source

The name of the underlying database column or “” if not supported.

@return [String]

# File lib/ogr/layer_mixins/ogr_sql_methods.rb, line 24
def fid_column
  name, ptr = FFI::OGR::API.OGR_L_GetFIDColumn(@c_pointer)
  ptr.autorelease = false

  name
end
geometry_column() click to toggle source

The name of the underlying database column being used as the geometry column. Returns “” if not supported.

@return [String]

# File lib/ogr/layer_mixins/ogr_sql_methods.rb, line 35
def geometry_column
  name, ptr = FFI::OGR::API.OGR_L_GetGeometryColumn(@c_pointer)
  ptr.autorelease = false

  name
end
rollback_transaction() click to toggle source

@raise [OGR::Failure]

# File lib/ogr/layer_mixins/ogr_sql_methods.rb, line 17
def rollback_transaction
  transact { FFI::OGR::API.OGR_L_RollbackTransaction(@c_pointer) }
end
start_transaction() click to toggle source

@raise [OGR::Failure]

# File lib/ogr/layer_mixins/ogr_sql_methods.rb, line 7
def start_transaction
  transact { FFI::OGR::API.OGR_L_StartTransaction(@c_pointer) }
end

Private Instance Methods

transact() { || ... } click to toggle source

@raise [OGR::Failure]

# File lib/ogr/layer_mixins/ogr_sql_methods.rb, line 45
def transact
  raise OGR::UnsupportedOperation, "This layer does not support transactions." unless supports_transactions?

  ogr_err = yield

  OGR::ErrorHandling.handle_ogr_err("Unable to set geometry directly on feature") do
    ogr_err
  end
end