Class: QgsProfileRequest¶
- class qgis.core.QgsProfileRequest¶
Bases:
sip.wrapper
Encapsulates properties and constraints relating to fetching elevation profiles from different sources.
New in version 3.26.
QgsProfileRequest(curve:
QgsCurve
) Constructor for QgsProfileRequest.The
curve
argument specifies the line along which the profile should be generated. Ownership is transferred to the request.QgsProfileRequest(other:
QgsProfileRequest
) Copy constructor.Methods
Returns the desired Coordinate Reference System for the profile.
Returns the expression context used to evaluate expressions.
Returns the cross section profile curve, which represents the line along which the profile should be generated.
Sets the desired Coordinate Reference System (
crs
) for the profile.Sets the expression context used to evaluate expressions.
Sets the cross section profile
curve
, which represents the line along which the profile should be generated.Sets the profile step
distance
(incrs()
units).Sets the terrain
provider
.Sets the tolerance of the request (in
crs()
units).Sets the transform
context
, for use when transforming coordinates from a source to the request'scrs()
Returns the profile step distance (in
crs()
units).Returns the terrain provider.
Returns the tolerance of the request (in
crs()
units).Returns the transform context, for use when transforming coordinates from a source to the request's
crs()
- crs(self) QgsCoordinateReferenceSystem ¶
Returns the desired Coordinate Reference System for the profile.
This also represents the CRS associated with the
profileCurve()
.See also
- Return type:
- expressionContext(self) QgsExpressionContext ¶
Returns the expression context used to evaluate expressions.
See also
- Return type:
- profileCurve(self) QgsCurve ¶
Returns the cross section profile curve, which represents the line along which the profile should be generated.
The coordinate reference system of the curve is retrieved via
crs()
.See also
- Return type:
- setCrs(self, crs: QgsCoordinateReferenceSystem) QgsProfileRequest ¶
Sets the desired Coordinate Reference System (
crs
) for the profile.This also represents the CRS associated with the
profileCurve()
.See also
- Parameters:
crs (QgsCoordinateReferenceSystem) –
- Return type:
- setExpressionContext(self, context: QgsExpressionContext) QgsProfileRequest ¶
Sets the expression context used to evaluate expressions.
See also
- Parameters:
context (QgsExpressionContext) –
- Return type:
- setProfileCurve(self, curve: QgsCurve) QgsProfileRequest ¶
Sets the cross section profile
curve
, which represents the line along which the profile should be generated.Ownership of
curve
is transferred to the request.The coordinate reference system of the
curve
is set viasetCrs()
.See also
- Parameters:
curve (QgsCurve) –
- Return type:
- setStepDistance(self, distance: float) QgsProfileRequest ¶
Sets the profile step
distance
(incrs()
units).This value determines the approximate distance between sampled points along the
profileCurve()
. Depending on the sources sampled, smaller step distances may be used in some circumstances. Effectively, this value is the “smallest permissible maximum distance between sampled points”.Smaller distances will take longer to calculate.
A NaN
distance
value will cause an appropriate step distance to be automatically calculated.See also
- Parameters:
distance (float) –
- Return type:
- setTerrainProvider(self, provider: QgsAbstractTerrainProvider) QgsProfileRequest ¶
Sets the terrain
provider
.Ownership of
provider
is transferred to the request.See also
- Parameters:
provider (QgsAbstractTerrainProvider) –
- Return type:
- setTolerance(self, tolerance: float) QgsProfileRequest ¶
Sets the tolerance of the request (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. Other sources may completely ignore this tolerance if it is not appropriate for the particular source.See also
- Parameters:
tolerance (float) –
- Return type:
- setTransformContext(self, context: QgsCoordinateTransformContext) QgsProfileRequest ¶
Sets the transform
context
, for use when transforming coordinates from a source to the request’scrs()
See also
- Parameters:
context (QgsCoordinateTransformContext) –
- Return type:
- stepDistance(self) float ¶
Returns the profile step distance (in
crs()
units).This value determines the approximate distance between sampled points along the
profileCurve()
. Depending on the sources sampled, smaller step distances may be used in some circumstances. Effectively, this value is the “smallest permissible maximum distance between sampled points”.Smaller distances will take longer to calculate.
A NaN distance value indicates that an appropriate step distance will be automatically calculated.
See also
- Return type:
float
- terrainProvider(self) QgsAbstractTerrainProvider ¶
Returns the terrain provider.
See also
- Return type:
- tolerance(self) float ¶
Returns the tolerance of the request (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. Other sources may completely ignore this tolerance if it is not appropriate for the particular source.See also
- Return type:
float
- transformContext(self) QgsCoordinateTransformContext ¶
Returns the transform context, for use when transforming coordinates from a source to the request’s
crs()
See also
- Return type: