Class Feature
This class that wraps an OGR Feature, needs to be instantiated from a Layer object.
Declaration
source linkDocumentation
Methods
▷ def __eq__(self, other) Do equivalence testing on the features.
▶ def __getitem__(self, index) Get the Field object at the specified index, which may be either
an integer or the Field's string label. Note that the Field object
is not the field's _value_ -- use the `get` method instead to
retrieve the value (e.g. an integer) instead of a Field instance.
▷ def __init__(self, feat, layer) Initialize Feature from a pointer and its Layer object.
▷ def __len__(self) Return the count of fields in this feature.
▷ def __str__(self) The string name of the feature.
@property
def encoding(self)
▷ def fid(self) @property Return the feature identifier.
▷ def fields(self) @property Return a list of fields in the Feature.
@property
def fields(self)
▷ def geom(self) @property Return the OGR Geometry for this Feature.
▷ def geom_type(self) @property Return the OGR Geometry Type for this Feature.
@property
def geom_type(self)
▷ def get(self, field) Return the value of the field, instead of an instance of the Field object. May take a string of the field name or a Field object as parameters.
▷ def index(self, field_name) Return the index of the given field name.
▷ def layer_name(self) @property Return the name of the layer for the feature.
@property
def layer_name(self)
▷ def num_fields(self) @property Return the number of fields in the Feature.
@property
def num_fields(self)
Inherited methods
Reexports