Class: QgsPointCloudLayer

class qgis.core.QgsPointCloudLayer

Bases: QgsMapLayer, QgsAbstractProfileSource

Represents a map layer supporting display of point clouds

Note

The API is considered EXPERIMENTAL and can be changed without a notice

Added in version 3.18.

QgsPointCloudLayer(uri: Optional[str] = ‘’, baseName: Optional[str] = ‘’, providerLib: Optional[str] = ‘’, options: QgsPointCloudLayer.LayerOptions = QgsPointCloudLayer.LayerOptions()) Constructor - creates a point cloud layer

Enums

PointCloudStatisticsCalculationState

Bases: enum.IntEnum

Methods

appendError

Add error message

attributes

Returns the attributes available from the layer.

childEvent

clone

rtype:

Optional[QgsPointCloudLayer]

connectNotify

convertRenderer3DFromRenderer2D

Updates the layer's 3D renderer's symbol to match that of the layer's 2D renderer

createMapRenderer

param rendererContext:

createProfileGenerator

param request:

customEvent

dataProvider

rtype:

Optional[QgsPointCloudDataProvider]

decodedSource

param source:

disconnectNotify

elevationProperties

rtype:

Optional[QgsMapLayerElevationProperties]

encodedSource

param source:

extent

rtype:

QgsRectangle

hasDependencyCycle

Checks whether a new set of dependencies will introduce a cycle this method is now deprecated and always return False, because circular dependencies are now correctly managed.

htmlMetadata

rtype:

str

invalidateWgs84Extent

Invalidates the WGS84 extent.

isSignalConnected

loadDefaultStyle

pointCount

Returns the total number of points available in the layer.

readCommonStyle

Read style data common to all layer types

readCustomProperties

Read custom properties from project file.

readStyle

param node:

readStyleManager

Read style manager's configuration (if any).

readSymbology

param node:

readXml

param layerNode:

receivers

renderer

Returns the 2D renderer for the point cloud.

sender

senderSignalIndex

setError

Sets error message

setExtent

Sets the extent

setExtent3D

Sets the extent

setProviderType

Sets the providerType (provider key)

setRenderer

Sets the 2D renderer for the point cloud.

setSubsetString

Sets the string used to define a subset of the layer

setSync3DRendererTo2DRenderer

Sets whether this layer's 3D renderer should be automatically updated with changes applied to the layer's 2D renderer

setTransformContext

param transformContext:

setValid

Sets whether layer is valid or not

statistics

Returns the object containing statistics

statisticsCalculationState

Returns the status of point cloud statistics calculation

subsetString

Returns the string used to define a subset of the layer.

sync3DRendererTo2DRenderer

Returns whether this layer's 3D renderer should be automatically updated with changes applied to the layer's 2D renderer

timerEvent

writeCommonStyle

Write style data common to all layer types

writeCustomProperties

Write custom properties to project file.

writeStyle

param node:

writeStyleManager

Write style manager's configuration (if exists).

writeSymbology

param node:

writeXml

param layerNode:

Signals

raiseError

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

statisticsCalculationStateChanged

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

subsetStringChanged

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

class LayerOptions(transformContext: QgsCoordinateTransformContext = QgsCoordinateTransformContext())

Bases: sip.wrapper

Constructor for LayerOptions with optional transformContext.

QgsPointCloudLayer.LayerOptions(a0: QgsPointCloudLayer.LayerOptions)

loadDefaultStyle
skipCrsValidation
skipIndexGeneration
skipStatisticsCalculation
transformContext
class PointCloudStatisticsCalculationState(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: enum.IntEnum

Point cloud statistics calculation task

Added in version 3.26.

  • NotStarted: The statistics calculation task has not been started

  • Calculating: The statistics calculation task is running

  • Calculated: The statistics calculation task is done and statistics are available

Calculated = 2
Calculating = 1
NotStarted = 0
baseClass

alias of QgsPointCloudLayer

appendError(self, error: QgsErrorMessage)

Add error message

attributes(self) QgsPointCloudAttributeCollection

Returns the attributes available from the layer.

Return type:

QgsPointCloudAttributeCollection

childEvent(self, a0: QChildEvent | None)
clone(self) QgsPointCloudLayer | None
Return type:

Optional[QgsPointCloudLayer]

connectNotify(self, signal: QMetaMethod)
convertRenderer3DFromRenderer2D(self) bool

Updates the layer’s 3D renderer’s symbol to match that of the layer’s 2D renderer

Return type:

bool

Returns:

True on success, False otherwise

Added in version 3.26.

createMapRenderer(self, rendererContext: QgsRenderContext) QgsMapLayerRenderer | None
Parameters:

rendererContext (QgsRenderContext)

Return type:

Optional[QgsMapLayerRenderer]

createProfileGenerator(self, request: QgsProfileRequest) QgsAbstractProfileGenerator | None
Parameters:

request (QgsProfileRequest)

Return type:

Optional[QgsAbstractProfileGenerator]

customEvent(self, a0: QEvent | None)
dataProvider(self) QgsPointCloudDataProvider | None
Return type:

Optional[QgsPointCloudDataProvider]

decodedSource(self, source: str | None, dataProvider: str | None, context: QgsReadWriteContext) str
Parameters:
Return type:

str

disconnectNotify(self, signal: QMetaMethod)
elevationProperties(self) QgsMapLayerElevationProperties | None
Return type:

Optional[QgsMapLayerElevationProperties]

encodedSource(self, source: str | None, context: QgsReadWriteContext) str
Parameters:
Return type:

str

extent(self) QgsRectangle
Return type:

QgsRectangle

hasDependencyCycle(self, a0: Iterable[QgsMapLayerDependency]) bool

Checks whether a new set of dependencies will introduce a cycle this method is now deprecated and always return False, because circular dependencies are now correctly managed.

Deprecated since version QGIS: 3.10

htmlMetadata(self) str
Return type:

str

invalidateWgs84Extent(self)

Invalidates the WGS84 extent. If FlagTrustLayerMetadata is enabled, the extent is not invalidated because we want to trust metadata whatever happens.

Added in version 3.20.

isSignalConnected(self, signal: QMetaMethod) bool
loadDefaultStyle(self)
pointCount(self) int

Returns the total number of points available in the layer.

Return type:

int

raiseError

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...)

  • revision (int = ...)

  • arguments (Sequence = ...)

Return type:

PYQT_SIGNAL

readCommonStyle(self, layerElement: QDomElement, context: QgsReadWriteContext, categories: QgsMapLayer.StyleCategories | QgsMapLayer.StyleCategory = QgsMapLayer.AllStyleCategories)

Read style data common to all layer types

readCustomProperties(self, layerNode: QDomNode, keyStartsWith: str | None = '')

Read custom properties from project file.

Parameters:
  • layerNode – note to read from

  • keyStartsWith – reads only properties starting with the specified string (or all if the string is empty)

readStyle(self, node: QDomNode, errorMessage: str | None, context: QgsReadWriteContext, categories: QgsMapLayer.StyleCategories | QgsMapLayer.StyleCategory = QgsMapLayer.AllStyleCategories) bool
Parameters:
Return type:

bool

readStyleManager(self, layerNode: QDomNode)

Read style manager’s configuration (if any). To be called by subclasses.

readSymbology(self, node: QDomNode, errorMessage: str | None, context: QgsReadWriteContext, categories: QgsMapLayer.StyleCategories | QgsMapLayer.StyleCategory = QgsMapLayer.AllStyleCategories) bool
Parameters:
Return type:

bool

readXml(self, layerNode: QDomNode, context: QgsReadWriteContext) bool
Parameters:
Return type:

bool

receivers(self, signal: PYQT_SIGNAL) int
renderer(self) QgsPointCloudRenderer | None

Returns the 2D renderer for the point cloud.

See also

setRenderer()

Return type:

Optional[QgsPointCloudRenderer]

sender(self) QObject | None
senderSignalIndex(self) int
setError(self, error: QgsError)

Sets error message

setExtent(self, rect: QgsRectangle)

Sets the extent

setExtent3D(self, box: QgsBox3D)

Sets the extent

Added in version 3.36.

setProviderType(self, providerType: str | None)

Sets the providerType (provider key)

setRenderer(self, renderer: QgsPointCloudRenderer | None)

Sets the 2D renderer for the point cloud.

Ownership of renderer is transferred to the layer.

See also

renderer()

Parameters:

renderer (Optional[QgsPointCloudRenderer])

setSubsetString(self, subset: str | None) bool

Sets the string used to define a subset of the layer

Parameters:

subset (Optional[str]) – The subset string to be used in a :py:class:`QgsPointCloudExpression`

Return type:

bool

Returns:

True, when setting the subset string was successful, False otherwise

Added in version 3.26.

setSync3DRendererTo2DRenderer(self, sync: bool)

Sets whether this layer’s 3D renderer should be automatically updated with changes applied to the layer’s 2D renderer

Added in version 3.26.

Parameters:

sync (bool)

setTransformContext(self, transformContext: QgsCoordinateTransformContext)
Parameters:

transformContext (QgsCoordinateTransformContext)

setValid(self, valid: bool)

Sets whether layer is valid or not

statistics(self) QgsPointCloudStatistics

Returns the object containing statistics

Added in version 3.26.

Return type:

QgsPointCloudStatistics

statisticsCalculationState(self) QgsPointCloudLayer.PointCloudStatisticsCalculationState

Returns the status of point cloud statistics calculation

Added in version 3.26.

Return type:

QgsPointCloudLayer.PointCloudStatisticsCalculationState

statisticsCalculationStateChanged

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...)

  • revision (int = ...)

  • arguments (Sequence = ...)

Return type:

PYQT_SIGNAL

subsetString(self) str

Returns the string used to define a subset of the layer.

Return type:

str

Returns:

The subset string or null QString if not implemented by the provider

Added in version 3.26.

subsetStringChanged

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...)

  • revision (int = ...)

  • arguments (Sequence = ...)

Return type:

PYQT_SIGNAL

sync3DRendererTo2DRenderer(self) bool

Returns whether this layer’s 3D renderer should be automatically updated with changes applied to the layer’s 2D renderer

Added in version 3.26.

Return type:

bool

timerEvent(self, a0: QTimerEvent | None)
writeCommonStyle(self, layerElement: QDomElement, document: QDomDocument, context: QgsReadWriteContext, categories: QgsMapLayer.StyleCategories | QgsMapLayer.StyleCategory = QgsMapLayer.AllStyleCategories)

Write style data common to all layer types

writeCustomProperties(self, layerNode: QDomNode, doc: QDomDocument)

Write custom properties to project file.

writeStyle(self, node: QDomNode, doc: QDomDocument, errorMessage: str | None, context: QgsReadWriteContext, categories: QgsMapLayer.StyleCategories | QgsMapLayer.StyleCategory = QgsMapLayer.AllStyleCategories) bool
Parameters:
Return type:

bool

writeStyleManager(self, layerNode: QDomNode, doc: QDomDocument)

Write style manager’s configuration (if exists). To be called by subclasses.

writeSymbology(self, node: QDomNode, doc: QDomDocument, errorMessage: str | None, context: QgsReadWriteContext, categories: QgsMapLayer.StyleCategories | QgsMapLayer.StyleCategory = QgsMapLayer.AllStyleCategories) bool
Parameters:
Return type:

bool

writeXml(self, layerNode: QDomNode, doc: QDomDocument, context: QgsReadWriteContext) bool
Parameters:
Return type:

bool