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

crs

Returns the desired Coordinate Reference System for the profile.

expressionContext

Returns the expression context used to evaluate expressions.

profileCurve

Returns the cross section profile curve, which represents the line along which the profile should be generated.

setCrs

Sets the desired Coordinate Reference System (crs) for the profile.

setExpressionContext

Sets the expression context used to evaluate expressions.

setProfileCurve

Sets the cross section profile curve, which represents the line along which the profile should be generated.

setStepDistance

Sets the profile step distance (in crs() units).

setTerrainProvider

Sets the terrain provider.

setTolerance

Sets the tolerance of the request (in crs() units).

setTransformContext

Sets the transform context, for use when transforming coordinates from a source to the request's crs()

stepDistance

Returns the profile step distance (in crs() units).

terrainProvider

Returns the terrain provider.

tolerance

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

transformContext

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

setCrs()

Return type:

QgsCoordinateReferenceSystem

expressionContext(self) QgsExpressionContext

Returns the expression context used to evaluate expressions.

Return type:

QgsExpressionContext

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().

Return type:

QgsCurve

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

crs()

Parameters:

crs (QgsCoordinateReferenceSystem) –

Return type:

QgsProfileRequest

setExpressionContext(self, context: QgsExpressionContext) QgsProfileRequest

Sets the expression context used to evaluate expressions.

Parameters:

context (QgsExpressionContext) –

Return type:

QgsProfileRequest

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 via setCrs().

See also

profileCurve()

Parameters:

curve (QgsCurve) –

Return type:

QgsProfileRequest

setStepDistance(self, distance: float) QgsProfileRequest

Sets 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 will cause an appropriate step distance to be automatically calculated.

See also

stepDistance()

Parameters:

distance (float) –

Return type:

QgsProfileRequest

setTerrainProvider(self, provider: QgsAbstractTerrainProvider) QgsProfileRequest

Sets the terrain provider.

Ownership of provider is transferred to the request.

Parameters:

provider (QgsAbstractTerrainProvider) –

Return type:

QgsProfileRequest

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

tolerance()

Parameters:

tolerance (float) –

Return type:

QgsProfileRequest

setTransformContext(self, context: QgsCoordinateTransformContext) QgsProfileRequest

Sets the transform context, for use when transforming coordinates from a source to the request’s crs()

Parameters:

context (QgsCoordinateTransformContext) –

Return type:

QgsProfileRequest

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.

Return type:

float

terrainProvider(self) QgsAbstractTerrainProvider

Returns the terrain provider.

Return type:

QgsAbstractTerrainProvider

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

setTolerance()

Return type:

float

transformContext(self) QgsCoordinateTransformContext

Returns the transform context, for use when transforming coordinates from a source to the request’s crs()

Return type:

QgsCoordinateTransformContext