Class: QgsElevationProfile

Represents an elevation profile attached to a project.

Added in version 4.0.

Class Hierarchy

Inheritance diagram of qgis.core.QgsElevationProfile

Base classes

QObject

class qgis.core.QgsElevationProfile[source]

Bases: QObject

__init__(project: QgsProject | None)

Constructor for QgsElevationProfile.

Parameters:

project (Optional[QgsProject])

crs(self) QgsCoordinateReferenceSystem[source]

Returns the crs associated with the profile’s map coordinates.

See also

setCrs()

Return type:

QgsCoordinateReferenceSystem

distanceUnit(self) Qgis.DistanceUnit[source]

Returns the distance unit used by the profile.

Return type:

Qgis.DistanceUnit

icon(self) QIcon[source]

Returns the icon to use for the elevation profile.

Return type:

QIcon

layerTree(self) QgsLayerTree | None[source]

Returns the layer tree used by the profile.

Will be None if useProjectLayerTree() is True.

Return type:

Optional[QgsLayerTree]

lockAxisScales(self) bool[source]

Returns True if the distance and elevation scales are locked to each other.

Return type:

bool

name(self) str[source]

Returns the profile’s unique name.

See also

setName()

See also

nameChanged()

Return type:

str

signal nameChanged[source]

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.

profileCurve(self) QgsCurve | None[source]

Returns the profile curve.

The CRS associated with the curve is retrieved via crs().

Return type:

Optional[QgsCurve]

readXml(self, element: QDomElement, document: QDomDocument, context: QgsReadWriteContext) bool[source]

Sets the profiles’s state from a DOM element.

element is the DOM node corresponding to the profile.

See also

writeXml()

Parameters:
Return type:

bool

resolveReferences(self, project: QgsProject | None)[source]

After reading settings from XML, resolves references to any layers in a project that have been read as layer IDs.

See also

readXml()

Parameters:

project (Optional[QgsProject])

setCrs(self, crs: QgsCoordinateReferenceSystem)[source]

Sets the crs associated with the profile’s map coordinates.

See also

crs()

Parameters:

crs (QgsCoordinateReferenceSystem)

setDistanceUnit(self, unit: Qgis.DistanceUnit)[source]

Sets the distance unit used by the profile.

See also

distanceUnit()

Parameters:

unit (Qgis.DistanceUnit)

setLockAxisScales(self, lock: bool)[source]

Sets whether the distance and elevation scales are locked to each other.

See also

lockAxisScales()

Parameters:

lock (bool)

setName(self, name: str | None)[source]

Sets the profile’s unique name.

See also

name()

See also

nameChanged()

Parameters:

name (Optional[str])

setProfileCurve(self, curve: QgsCurve | None)[source]

Sets the profile curve.

The CRS associated with curve is set via setCrs().

Ownership is transferred to the profile.

See also

profileCurve()

Parameters:

curve (Optional[QgsCurve])

setSubsectionsSymbol(self, symbol: QgsLineSymbol | None)[source]

Sets the symbol used to draw the subsections.

If symbol is None, the subsections are not drawn. Ownership of symbol is transferred.

Parameters:

symbol (Optional[QgsLineSymbol])

setTolerance(self, tolerance: float)[source]

Sets the profile tolerance (in crs() units).

This value determines how far from the profileCurve() is appropriate for inclusion of results. For instance, when a profile is generated for a point vector layer this tolerance distance will dictate how far from the actual profile curve a point can reside within to be included in the results.

See also

tolerance()

Parameters:

tolerance (float)

setUseProjectLayerTree(self, useProjectTree: bool)[source]

Sets whether the profile should always use the project’s layer tree

i.e. the profiles layer tree will be synchronized to the project and no reordering or re-grouping of layers is supported.

See also

layerTree()

Parameters:

useProjectTree (bool)

subsectionsSymbol(self) QgsLineSymbol | None[source]

Returns the symbol used to draw the subsections.

Return type:

Optional[QgsLineSymbol]

tolerance(self) float[source]

Returns the tolerance of the profile (in crs() units).

This value determines how far from the profileCurve() is appropriate for inclusion of results. For instance, when a profile is generated for a point vector layer this tolerance distance will dictate how far from the actual profile curve a point can reside within to be included in the results.

See also

setTolerance()

Return type:

float

useProjectLayerTree(self) bool[source]

Returns True if the profile should always use the project’s layer tree

i.e. the profiles layer tree will be synchronized to the project and no reordering or re-grouping of layers is supported.

See also

layerTree()

Return type:

bool

signal useProjectLayerTreeChanged[source]

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.

writeXml(self, document: QDomDocument, context: QgsReadWriteContext) QDomElement[source]

Returns the profiles’s state encapsulated in a DOM element.

See also

readXml()

Parameters:
Return type:

QDomElement