Class: QgsElevationProfileCanvas¶
A canvas for elevation profiles.
Added in version 3.26.
Class Hierarchy¶
Base classes¶
Plot canvas is a class for displaying interactive 2d charts and plots. |
|
- class qgis.gui.QgsElevationProfileCanvas[source]¶
Bases:
QgsPlotCanvas- __init__(parent: QWidget | None = None)
Constructor for QgsElevationProfileCanvas, with the specified
parentwidget.- Parameters:
parent (Optional[QWidget] = None)
- signal activeJobCountChanged[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.
- axisScaleRatio(self) float[source]¶
Returns the current ratio of horizontal (distance) to vertical (elevation) scale for the plot.
See also
Added in version 4.0.
- Return type:
float
- signal canvasPointHovered[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.
- canvasPointToPlotPoint(self, point: QPointF | QPoint) QgsProfilePoint[source]¶
Converts a canvas point to the equivalent plot point.
See also
- Parameters:
point (Union[QPointF, QPoint])
- Return type:
- distanceUnit(self) Qgis.DistanceUnit[source]¶
Returns the distance unit used by the canvas.
See also
Added in version 3.32.
- Return type:
- identify(self, point: QPointF | QPoint) List[QgsProfileIdentifyResults]¶
Identify results visible at the specified plot point.
identify(self, rect: QRectF) -> List[QgsProfileIdentifyResults] Identify results visible within the specified plot rect.
- Parameters:
point (Union[QPointF, QPoint])
- Return type:
- invalidateCurrentPlotExtent(self)[source]¶
Invalidates the current plot extent, which means that the visible plot area will be recalculated and “zoom full” operation occur when the next profile generation completes.
- layers(self) List[QgsMapLayer]¶
Returns the list of layers included in the profile.
See also
- Return type:
- lockAxisScales(self) bool[source]¶
Returns
Trueif the distance and elevation scales are locked to each other.See also
Added in version 3.32.
- Return type:
bool
- plotArea(self) QRectF[source]¶
Returns the interior rectangle representing the surface of the plot, in canvas coordinates.
- Return type:
QRectF
- plotPointToCanvasPoint(self, point: QgsProfilePoint) QgsPointXY[source]¶
Converts a plot point to the equivalent canvas point.
See also
- Parameters:
point (QgsProfilePoint)
- Return type:
- 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]
- virtual refresh(self)[source]¶
Triggers a complete regeneration of the profile, causing the profile extraction to perform in the background.
- render(self, context: QgsRenderContext, width: float, height: float, plotSettings: Qgs2DXyPlot)[source]¶
Renders a portion of the profile using the specified render
context.- Parameters:
context (QgsRenderContext)
width (float)
height (float)
plotSettings (Qgs2DXyPlot)
- signal scaleChanged[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.
- virtual scalePlot(self, factor: float)[source]¶
Scales the plot axis by the given factors.
- Parameters:
xFactor (float)
yFactor (float)
- setAxisScaleRatio(self, scale: float)[source]¶
Sets the ratio of horizontal (distance) to vertical (elevation) scale for the plot.
E.g. a
scaleof 3 indicates a ratio of 3:1 for distance vs elevation, whereas a scale of 0.3333 indicates a ratio of 1:3 for distance vs elevation.This will immediately update the visible plot area to match the specified scale.
See also
See also
Added in version 4.0.
- Parameters:
scale (float)
- setBackgroundColor(self, color: QColor | Qt.GlobalColor)[source]¶
Sets the background
colorto use for the profile canvas.The chart text, border and axis color will be automatically updated to ensure readability with the new background color.
Added in version 3.34.
- Parameters:
color (Union[QColor, Qt.GlobalColor])
- setCrs(self, crs: QgsCoordinateReferenceSystem)[source]¶
Sets the
crsassociated with the canvas’ map coordinates.See also
crs()- Parameters:
- setDistanceUnit(self, unit: Qgis.DistanceUnit)[source]¶
Sets the distance
unitused by the canvas.See also
Added in version 3.32.
- Parameters:
unit (Qgis.DistanceUnit)
- setLayers(self, layers: Iterable[QgsMapLayer])[source]¶
Sets the list of
layersto 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
Added in version 3.32.
- Parameters:
lock (bool)
- setProfileCurve(self, curve: QgsCurve | None)[source]¶
Sets the profile
curve.The CRS associated with
curveis set viasetCrs().Ownership is transferred to the plot canvas.
See also
- Parameters:
curve (Optional[QgsCurve])
- setProject(self, project: QgsProject | None)[source]¶
Sets the
projectassociated with the profile.This must be set before any layers which utilize terrain based elevation settings can be included in the canvas.
- Parameters:
project (Optional[QgsProject])
- setSnappingEnabled(self, enabled: bool)[source]¶
Sets whether snapping of cursor points is enabled.
- Parameters:
enabled (bool)
- setSources(self, sources: Iterable[QgsAbstractProfileSource])[source]¶
Sets the list of
sourcesto include in the profile.See also
- Parameters:
sources (Iterable[QgsAbstractProfileSource])
- setSubsectionsSymbol(self, symbol: QgsLineSymbol | None)[source]¶
Sets the
symbolused to draw the subsections. IfsymbolisNone, the subsections are not drawn. Ownership ofsymbolis transferred.See also
Added in version 3.44.
- 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)
- setVisiblePlotRange(self, minimumDistance: float, maximumDistance: float, minimumElevation: float, maximumElevation: float)[source]¶
Sets the visible area of the plot.
See also
See also
- Parameters:
minimumDistance (float)
maximumDistance (float)
minimumElevation (float)
maximumElevation (float)
- sources(self) List[QgsAbstractProfileSource]¶
Returns the list of sources included in the profile.
It includes both layer profile sources and custom sources from the profile source registry.
See also
- Return type:
- subsectionsSymbol(self) QgsLineSymbol | None[source]¶
Returns the symbol used to draw the subsections.
See also
Added in version 3.44.
- 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
- visibleDistanceRange(self) QgsDoubleRange[source]¶
Returns the distance range currently visible in the plot.
See also
See also
- Return type:
- visibleElevationRange(self) QgsDoubleRange[source]¶
Returns the elevation range currently visible in the plot.
See also
See also
- Return type: