Module: OGR::LayerMixins::CapabilityMethods

Included in:
OGR::Layer
Defined in:
lib/ogr/extensions/layer/capability_methods.rb

Overview

Helper methods for checking what the Layer is capable of.

Instance Method Summary collapse

Instance Method Details

#can_alter_field_definition?Boolean

Returns true if the Layer supports altering the defintition of an existing field on the current layer.

Returns:

  • (Boolean)

    true if the Layer supports altering the defintition of an existing field on the current layer.



77
78
79
# File 'lib/ogr/extensions/layer/capability_methods.rb', line 77

def can_alter_field_definition?
  test_capability("AlterFieldDefn")
end

#can_create_field?Boolean

Returns true if new Fields can be created on this Layer.

Returns:

  • (Boolean)

    true if new Fields can be created on this Layer.



53
54
55
# File 'lib/ogr/extensions/layer/capability_methods.rb', line 53

def can_create_field?
  test_capability("CreateField")
end

#can_create_geometry_field?Boolean

Returns true if the Layer supports creating new geometry fields on the current layer.

Returns:

  • (Boolean)

    true if the Layer supports creating new geometry fields on the current layer.



59
60
61
# File 'lib/ogr/extensions/layer/capability_methods.rb', line 59

def can_create_geometry_field?
  test_capability("CreateGeomField")
end

#can_delete_feature?Boolean

Returns true if the Layer supports deleting Features.

Returns:

  • (Boolean)

    true if the Layer supports deleting Features.



82
83
84
# File 'lib/ogr/extensions/layer/capability_methods.rb', line 82

def can_delete_feature?
  test_capability("DeleteFeature")
end

#can_delete_field?Boolean

Returns true if the Layer supports deleting existing fields on the current layer.

Returns:

  • (Boolean)

    true if the Layer supports deleting existing fields on the current layer.



65
66
67
# File 'lib/ogr/extensions/layer/capability_methods.rb', line 65

def can_delete_field?
  test_capability("DeleteField")
end

#can_fast_feature_count?Boolean

Returns true if this layer can return a feature count efficiently (i.e. without counting all of the features).

Returns:

  • (Boolean)

    true if this layer can return a feature count efficiently (i.e. without counting all of the features).



36
37
38
# File 'lib/ogr/extensions/layer/capability_methods.rb', line 36

def can_fast_feature_count?
  test_capability("FastFeatureCount")
end

#can_fast_get_extent?Boolean

Returns true if this Layer can return its extent efficiently (i.e. without scanning all of the features.).

Returns:

  • (Boolean)

    true if this Layer can return its extent efficiently (i.e. without scanning all of the features.).



42
43
44
# File 'lib/ogr/extensions/layer/capability_methods.rb', line 42

def can_fast_get_extent?
  test_capability("FastGetExtent")
end

#can_fast_set_next_by_index?Boolean

Returns true if this layer can perform the #next_feature_index= call efficiently.

Returns:

  • (Boolean)

    true if this layer can perform the #next_feature_index= call efficiently.



48
49
50
# File 'lib/ogr/extensions/layer/capability_methods.rb', line 48

def can_fast_set_next_by_index?
  test_capability("FastSetNextByIndex")
end

#can_fast_spatial_filter?Boolean

Returns true if this layer implements spatial filtering efficiently. This can be used as a clue by the application whether it should build and maintain its own spatial index for features in this layer.

Returns:

  • (Boolean)

    true if this layer implements spatial filtering efficiently. This can be used as a clue by the application whether it should build and maintain its own spatial index for features in this layer.



30
31
32
# File 'lib/ogr/extensions/layer/capability_methods.rb', line 30

def can_fast_spatial_filter?
  test_capability("FastSpatialFilter")
end

#can_random_read?Boolean

Returns true if #feature() is implemented in an optimized manner for this layer (as opposed to using #next_feature and #reset_reading).

Returns:

  • (Boolean)

    true if #feature() is implemented in an optimized manner for this layer (as opposed to using #next_feature and #reset_reading).



12
13
14
# File 'lib/ogr/extensions/layer/capability_methods.rb', line 12

def can_random_read?
  test_capability("RandomRead")
end

#can_random_write?Boolean

Returns true if #feature= is allowed on this layer.

Returns:

  • (Boolean)

    true if #feature= is allowed on this layer.



22
23
24
# File 'lib/ogr/extensions/layer/capability_methods.rb', line 22

def can_random_write?
  test_capability("RandomWrite")
end

#can_reorder_fields?Boolean

Returns true if the Layer supports reording fields on the current layer.

Returns:

  • (Boolean)

    true if the Layer supports reording fields on the current layer.



71
72
73
# File 'lib/ogr/extensions/layer/capability_methods.rb', line 71

def can_reorder_fields?
  test_capability("ReorderFields")
end

#can_sequential_write?Boolean

Returns true if #create_feature is allowed on this layer.

Returns:

  • (Boolean)

    true if #create_feature is allowed on this layer.



17
18
19
# File 'lib/ogr/extensions/layer/capability_methods.rb', line 17

def can_sequential_write?
  test_capability("SequentialWrite")
end

#strings_are_utf_8?Boolean

Returns true if :OFTString fields are guaranteed to be in UTF-8.

Returns:

  • (Boolean)

    true if :OFTString fields are guaranteed to be in UTF-8.



88
89
90
# File 'lib/ogr/extensions/layer/capability_methods.rb', line 88

def strings_are_utf_8?
  test_capability("StringsAsUTF8")
end

#supports_curve_geometries?Boolean

Returns true if this Layer supports reading or writing curve geometries.

Returns:

  • (Boolean)

    true if this Layer supports reading or writing curve geometries.



101
102
103
# File 'lib/ogr/extensions/layer/capability_methods.rb', line 101

def supports_curve_geometries?
  test_capability("CurveGeometries")
end

#supports_transactions?Boolean

Returns true if this Layer supports transactions. If not, #start_transaction, #commit_transaction, and #rollback_transaction will not work in a meaningful manner.

Returns:

  • (Boolean)

    true if this Layer supports transactions. If not, #start_transaction, #commit_transaction, and #rollback_transaction will not work in a meaningful manner.



95
96
97
# File 'lib/ogr/extensions/layer/capability_methods.rb', line 95

def supports_transactions?
  test_capability("Transactions")
end