Class: QgsElevationProfile¶
Represents an elevation profile attached to a project.
Added in version 4.0.
Class Hierarchy¶
Base classes¶
Methods
Returns the crs associated with the profile's map coordinates. |
|
Returns the distance unit used by the profile. |
|
Returns the icon to use for the elevation profile. |
|
Returns the list of layers included in the profile. |
|
Returns |
|
Returns the profile's unique name. |
|
Returns the profile curve. |
|
Sets the profiles's state from a DOM element. |
|
After reading settings from XML, resolves references to any layers in a project that have been read as layer IDs. |
|
Sets the crs associated with the profile's map coordinates. |
|
Sets the distance unit used by the profile. |
|
Sets the list of layers to include in the profile. |
|
Sets whether the distance and elevation scales are locked to each other. |
|
Sets the profile's unique name. |
|
Sets the profile curve. |
|
Sets the symbol used to draw the subsections. |
|
Sets the profile tolerance (in |
|
Returns the symbol used to draw the subsections. |
|
Returns the tolerance of the profile (in |
|
Returns the profiles's state encapsulated in a DOM element. |
Signals
Emitted when the profile is renamed. |
- 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:
- layers(self) List[QgsMapLayer] ¶
Returns the list of layers included in the profile.
See also
- Return type:
List[QgsMapLayer]
- lockAxisScales(self) bool [source]¶
Returns
True
if the distance and elevation scales are locked to each other.See also
- Return type:
bool
- signal nameChanged(newName: str)[source]¶
Emitted when the profile is renamed.
See also
See also
- Parameters:
newName (str)
- 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.
element
is 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
project
that have been read as layer IDs.See also
- Parameters:
project (Optional[QgsProject])
- setCrs(self, crs: QgsCoordinateReferenceSystem)[source]¶
Sets the
crs
associated with the profile’s map coordinates.See also
- Parameters:
- setDistanceUnit(self, unit: Qgis.DistanceUnit)[source]¶
Sets the distance
unit
used by the profile.See also
- Parameters:
unit (Qgis.DistanceUnit)
- setLayers(self, layers: Iterable[QgsMapLayer])[source]¶
Sets the list of
layers
to include in the profile.See also
- Parameters:
layers (Iterable[QgsMapLayer])
- 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
curve
is set viasetCrs()
.Ownership is transferred to the profile.
See also
- Parameters:
curve (Optional[QgsCurve])
- setSubsectionsSymbol(self, symbol: QgsLineSymbol | None)[source]¶
Sets the
symbol
used to draw the subsections.If
symbol
isNone
, the subsections are not drawn. Ownership ofsymbol
is 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)
- 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
- 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