Class: QgsProviderSublayerDetails¶
Contains details about a sub layer available from a dataset.
This class encapsulates the properties of a single sublayer available from a dataset, according to a specific data provider.
Note
It is possible that multiple data providers may be able to utilize the same underlying
sub layer in a single dataset, yet will interpret this layer differently. For instance, a layer
in a Geospatial PDF document can be interpreted as either a vector layer by the OGR data provider or a raster
layer by the GDAL provider. The providerKey()
property can be used to determine the data provider
associated with a QgsProviderSubLayerDetails
instance.
Added in version 3.22.
Methods
Returns the layer's description. |
|
Returns the layer's driver name. |
|
Returns the layer's feature count. |
|
Returns the layer's flags, which indicate properties of the layer. |
|
Returns the layer's geometry column name, or an empty string if not applicable. |
|
Returns the associated layer number, for providers which order sublayers. |
|
Returns the layer's name. |
|
Returns the path to the sublayer. |
|
Returns the associated data provider key. |
|
Sets the layer's description. |
|
Sets the layer's driver name. |
|
Sets the layer's feature count. |
|
Sets the layer's flags, which indicate properties of the layer. |
|
Sets the layer's geometry column name. |
|
Sets the associated layer number, for providers which order sublayers. |
|
Sets the layer's name. |
|
Sets the path to the sublayer. |
|
Sets the associated data provider key. |
|
Set to |
|
Sets the layer type. |
|
Sets the layer's uri. |
|
Set the layer's WKB type. |
|
Returns |
|
Creates a new |
|
Converts the sublayer details to a |
|
Returns the layer type. |
|
Returns the layer's URI. |
|
Returns the layer's WKB type, or |
- class qgis.core.QgsProviderSublayerDetails[source]¶
Bases:
object
- class LayerOptions¶
Bases:
object
Setting options for loading layers.
- loadAllStoredStyle: bool¶
Controls whether the stored styles will be all loaded.
If
True
and the layer’s provider supports style stored in the data source all the available styles will be loaded in addition to the default one.If
False
(the default), the layer’s provider will only load the default style.Added in version 3.30.
- loadDefaultStyle: bool¶
Set to
True
if the default layer style should be loaded
- transformContext: QgsCoordinateTransformContext¶
Coordinate transform context
- driverName(self) str [source]¶
Returns the layer’s driver name.
This is supported only for providers which handle multiple drivers.
See also
- Return type:
str
- featureCount(self) int ¶
Returns the layer’s feature count.
Will return
Qgis
.FeatureCountState.UnknownCount orQgis
.FeatureCountState.Uncounted if no feature count is applicable or available.See also
- Return type:
int
- flags(self) Qgis.SublayerFlags [source]¶
Returns the layer’s flags, which indicate properties of the layer.
See also
- Return type:
- geometryColumnName(self) str [source]¶
Returns the layer’s geometry column name, or an empty string if not applicable.
See also
- Return type:
str
- layerNumber(self) int [source]¶
Returns the associated layer number, for providers which order sublayers.
See also
- Return type:
int
- path(self) List[str] [source]¶
Returns the path to the sublayer.
This is an internal path, relative to the dataset itself. It can be used to encapsulate the hierarchy of a dataset which organises layers in schemas or in an internal folder structure.
See also
- Return type:
List[str]
- setDescription(self, description: str | None)[source]¶
Sets the layer’s
description
.See also
- Parameters:
description (Optional[str])
- setDriverName(self, driver: str | None)[source]¶
Sets the layer’s
driver
name.See also
- Parameters:
driver (Optional[str])
- setFeatureCount(self, count: int)[source]¶
Sets the layer’s feature
count
.Set to
Qgis
.FeatureCountState.UnknownCount orQgis
.FeatureCountState.Uncounted if no feature count is applicable or available.See also
- Parameters:
count (int)
- setFlags(self, newFlags: Qgis.SublayerFlags | Qgis.SublayerFlag)[source]¶
Sets the layer’s
flags
, which indicate properties of the layer.See also
- Parameters:
newFlags (Union[Qgis.SublayerFlags, Qgis.SublayerFlag])
- setGeometryColumnName(self, name: str | None)[source]¶
Sets the layer’s geometry column
name
.Set to an empty string if not applicable.
See also
- Parameters:
name (Optional[str])
- setLayerNumber(self, number: int)[source]¶
Sets the associated layer
number
, for providers which order sublayers.See also
- Parameters:
number (int)
- setName(self, name: str | None)[source]¶
Sets the layer’s
name
.See also
- Parameters:
name (Optional[str])
- setPath(self, path: Iterable[str | None])[source]¶
Sets the
path
to the sublayer.This is an internal path, relative to the dataset itself. It can be used to encapsulate the hierarchy of a dataset which organises layers in schemas or in an internal folder structure.
See also
- Parameters:
path (Iterable[Optional[str]])
- setProviderKey(self, key: str | None)[source]¶
Sets the associated data provider key.
See also
- Parameters:
key (Optional[str])
- setSkippedContainerScan(self, skipped: bool)[source]¶
Set to
True
if the layer is a potential dataset container and an in-depth scan of its contents was skipped.See also
- Parameters:
skipped (bool)
- setType(self, type: Qgis.LayerType)[source]¶
Sets the layer
type
.See also
- Parameters:
type (Qgis.LayerType)
- setUri(self, uri: str | None)[source]¶
Sets the layer’s
uri
.See also
- Parameters:
uri (Optional[str])
- setWkbType(self, type: Qgis.WkbType)[source]¶
Set the layer’s WKB
type
.Set to
QgsWkbTypes
.Unknown if the WKB type is not application or unknown.See also
- Parameters:
type (Qgis.WkbType)
- skippedContainerScan(self) bool [source]¶
Returns
True
if the layer is a potential dataset container and an in-depth scan of its contents was skipped.See also
- Return type:
bool
- toLayer(self, options: QgsProviderSublayerDetails.LayerOptions) QgsMapLayer | None [source]¶
Creates a new
QgsMapLayer
object associated with the sublayer.Caller takes ownership of the returned layer.
- Parameters:
options (QgsProviderSublayerDetails.LayerOptions)
- Return type:
Optional[QgsMapLayer]
- toMimeUri(self) QgsMimeDataUtils.Uri [source]¶
Converts the sublayer details to a
QgsMimeDataUtils
.Uri representing the sublayer.Added in version 3.28.
- Return type:
- type(self) Qgis.LayerType [source]¶
Returns the layer type.
See also
- Return type:
- wkbType(self) Qgis.WkbType [source]¶
Returns the layer’s WKB type, or
QgsWkbTypes
.Unknown if the WKB type is not application or unknown.See also
- Return type: