Class: QgsProviderUtils

class qgis.core.QgsProviderUtils

Bases: sip.wrapper

Contains utility functions for working with data providers.

Methods

sublayerDetailsAreIncomplete

Returns True if the sublayer details are incomplete, and require a more in-depth scan.

suggestLayerNameFromFilePath

Suggests a suitable layer name given only a file path.

sublayerDetailsAreIncomplete(details: Iterable[QgsProviderSublayerDetails], ignoreUnknownFeatureCount: bool)bool

Returns True if the sublayer details are incomplete, and require a more in-depth scan.

For instance, if the details contain any vector sublayers with unknown geometry types then a query with the Qgis.SublayerQueryFlag.ResolveGeometryType flag is required.

If ignoreUnknownFeatureCount is True then sublayers with an unknown feature count will not be considered as incomplete.

Parameters
Return type

bool

suggestLayerNameFromFilePath(path: str)str

Suggests a suitable layer name given only a file path.

Usually this corresponds to the base file name of path (e.g. “rivers” for a path of “c:/my data/water/rivers.shp”). However some data formats which use fixed file paths (such as aigrid files) will instead return the parent directory name (e.g. “rivers” for a path of “c:/my data/water/rivers/hdr.adf”).

Parameters

path (str) –

Return type

str