Class: QgsElevationProfile¶
Represents an elevation profile attached to a project.
Added in version 4.0.
Class Hierarchy¶
Base classes¶
- 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
- Return type:
- distanceUnit(self) Qgis.DistanceUnit[source]¶
Returns the distance unit used by the profile.
See also
- Return type:
- layerTree(self) QgsLayerTree | None[source]¶
Returns the layer tree used by the profile.
Will be
NoneifuseProjectLayerTree()isTrue.See also
See also
- Return type:
Optional[QgsLayerTree]
- lockAxisScales(self) bool[source]¶
Returns
Trueif the distance and elevation scales are locked to each other.See also
- Return type:
bool
- 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().See also
- Return type:
Optional[QgsCurve]
- readXml(self, element: QDomElement, document: QDomDocument, context: QgsReadWriteContext) bool[source]¶
Sets the profiles’s state from a DOM element.
elementis the DOM node corresponding to the profile.See also
See also
- Parameters:
element (QDomElement)
document (QDomDocument)
context (QgsReadWriteContext)
- Return type:
bool
- resolveReferences(self, project: QgsProject | None)[source]¶
After reading settings from XML, resolves references to any layers in a
projectthat have been read as layer IDs.See also
- Parameters:
project (Optional[QgsProject])
- setCrs(self, crs: QgsCoordinateReferenceSystem)[source]¶
Sets the
crsassociated with the profile’s map coordinates.See also
- Parameters:
- setDistanceUnit(self, unit: Qgis.DistanceUnit)[source]¶
Sets the distance
unitused by the profile.See also
- Parameters:
unit (Qgis.DistanceUnit)
- setLockAxisScales(self, lock: bool)[source]¶
Sets whether the distance and elevation scales are locked to each other.
See also
- Parameters:
lock (bool)
- setName(self, name: str | None)[source]¶
Sets the profile’s unique
name.See also
See also
- Parameters:
name (Optional[str])
- setProfileCurve(self, curve: QgsCurve | None)[source]¶
Sets the profile
curve.The CRS associated with
curveis set viasetCrs().Ownership is transferred to the profile.
See also
- Parameters:
curve (Optional[QgsCurve])
- setSubsectionsSymbol(self, symbol: QgsLineSymbol | None)[source]¶
Sets the
symbolused to draw the subsections.If
symbolisNone, the subsections are not drawn. Ownership ofsymbolis transferred.See also
- 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
- 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
See also
- Parameters:
useProjectTree (bool)
- subsectionsSymbol(self) QgsLineSymbol | None[source]¶
Returns the symbol used to draw the subsections.
See also
- 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
- Return type:
float
- useProjectLayerTree(self) bool[source]¶
Returns
Trueif the profile should always use the project’s layer treei.e. the profiles layer tree will be synchronized to the project and no reordering or re-grouping of layers is supported.
See also
See also
- 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
- Parameters:
document (QDomDocument)
context (QgsReadWriteContext)
- Return type:
QDomElement