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 |
Return a list containing the given field name for every Feature in the Layer. |
Method | get |
Return a list containing the OGRGeometry for every Feature in the Layer. |
Method | test |
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 |
Undocumented |
Instance Variable | ptr |
Undocumented |
Property | extent |
Return the extent (an Envelope) of this layer. |
Property | field |
Return the field precisions for the features. |
Property | field |
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 |
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 |
Return the geometry type (OGRGeomType) of the Layer. |
Property | name |
Return the name of this layer in the Data Source. |
Property | num |
Return the number of features in the Layer. |
Property | num |
Return the number of fields in the Layer. |
Property | srs |
Return the Spatial Reference used in this Layer. |
Method | _get |
Undocumented |
Method | _make |
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 |
Undocumented |
Instance Variable | _ds |
Undocumented |
Instance Variable | _ldefn |
Undocumented |
Instance Variable | _random |
Undocumented |
Inherited from CPointerBase
(via GDALBase
):
Method | __del__ |
Free the memory used by the C++ object. |
Method | ptr |
Undocumented |
Class Variable | destructor |
Undocumented |
Instance Variable | _ptr |
Undocumented |
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.
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'.
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.