girs.feat.layers.LayersSet.get_layer

LayersSet.get_layer(layer_number=0)

Return the OGRLayer instance for the given layer number

Use this method with care. If the layer is used after this instance (LayersSet) is destroyed, the system will probably crash. The following may also crash the system:

lyr = LayersReader(source='D:/tmp/test.shp').get_layer()

In order to avoid it, use:

lrs = LayersReader(source='D:/tmp/test.shp')
lyr = lrs.get_layer()
# lrs should be deleted only after lyr is used
del lrs
Parameters:layer_number – default is zero
Returns:OGRLayer