class documentation

A class that wraps an OGR Layer, needs to be instantiated from a DataSource object.

Method __getitem__ Get the Feature at the specified index.
Method __init__ Initialize on an OGR C pointer to the Layer and the `DataSource` object that owns this layer. The `DataSource` object is required so that a reference to it is kept with this Layer. This prevents garbage collection of the `DataSource` while this Layer is still active.
Method __iter__ Iterate over each Feature in the Layer.
Method __len__ The length is the number of features.
Method __str__ The string name of the layer.
Method get_fields Return a list containing the given field name for every Feature in the Layer.
Method get_geoms Return a list containing the OGRGeometry for every Feature in the Layer.
Method test_capability Return a bool indicating whether the this Layer supports the given capability (a string). Valid capability strings include: 'RandomRead', 'SequentialWrite', 'RandomWrite', 'FastSpatialFilter', 'FastFeatureCount', 'FastGetExtent', 'CreateField', 'Transactions', 'DeleteFeature', and 'FastSetNextByIndex'.
Class Variable spatial_filter Undocumented
Instance Variable ptr Undocumented
Property extent Return the extent (an Envelope) of this layer.
Property field_precisions Return the field precisions for the features.
Property field_types Return a list of the types of fields in this Layer. For example, return the list [OFTInteger, OFTReal, OFTString] for an OGR layer that has an integer, a floating-point, and string fields.
Property field_widths Return a list of the maximum field widths for the features.
Property fields Return a list of string names corresponding to each of the Fields available in this Layer.
Property geom_type Return the geometry type (OGRGeomType) of the Layer.
Property name Return the name of this layer in the Data Source.
Property num_feat Return the number of features in the Layer.
Property num_fields Return the number of fields in the Layer.
Property srs Return the Spatial Reference used in this Layer.
Method _get_spatial_filter Undocumented
Method _make_feature Helper routine for __getitem__ that constructs a Feature from the given Feature ID. If the OGR Layer does not support random-access reading, then each feature of the layer will be incremented through until the a Feature is found matching the given feature ID.
Method _set_spatial_filter Undocumented
Instance Variable _ds Undocumented
Instance Variable _ldefn Undocumented
Instance Variable _random_read Undocumented

Inherited from CPointerBase (via GDALBase):

Method __del__ Free the memory used by the C++ object.
Method ptr.setter Undocumented
Class Variable destructor Undocumented
Instance Variable _ptr Undocumented
def __getitem__(self, index): (source)

Get the Feature at the specified index.

def __init__(self, layer_ptr, ds): (source)

Initialize on an OGR C pointer to the Layer and the `DataSource` object that owns this layer. The `DataSource` object is required so that a reference to it is kept with this Layer. This prevents garbage collection of the `DataSource` while this Layer is still active.

def __iter__(self): (source)

Iterate over each Feature in the Layer.

def __len__(self): (source)

The length is the number of features.

def __str__(self): (source)

The string name of the layer.

def get_fields(self, field_name): (source)

Return a list containing the given field name for every Feature in the Layer.

def get_geoms(self, geos=False): (source)

Return a list containing the OGRGeometry for every Feature in the Layer.

def test_capability(self, capability): (source)

Return a bool indicating whether the this Layer supports the given capability (a string). Valid capability strings include: 'RandomRead', 'SequentialWrite', 'RandomWrite', 'FastSpatialFilter', 'FastFeatureCount', 'FastGetExtent', 'CreateField', 'Transactions', 'DeleteFeature', and 'FastSetNextByIndex'.

spatial_filter = (source)

Undocumented

Return the extent (an Envelope) of this layer.

@property
field_precisions = (source)

Return the field precisions for the features.

@property
field_types = (source)

Return a list of the types of fields in this Layer. For example, return the list [OFTInteger, OFTReal, OFTString] for an OGR layer that has an integer, a floating-point, and string fields.

@property
field_widths = (source)

Return a list of the maximum field widths for the features.

Return a list of string names corresponding to each of the Fields available in this Layer.

Return the geometry type (OGRGeomType) of the Layer.

Return the name of this layer in the Data Source.

Return the number of features in the Layer.

Return the number of fields in the Layer.

Return the Spatial Reference used in this Layer.

def _get_spatial_filter(self): (source)

Undocumented

def _make_feature(self, feat_id): (source)

Helper routine for __getitem__ that constructs a Feature from the given Feature ID. If the OGR Layer does not support random-access reading, then each feature of the layer will be incremented through until the a Feature is found matching the given feature ID.

def _set_spatial_filter(self, filter): (source)

Undocumented

Undocumented

Undocumented

_random_read = (source)

Undocumented