Class: QgsProfileGenerationContext

Encapsulates the context in which an elevation profile is to be generated.

Added in version 3.26.

class qgis.core.QgsProfileGenerationContext[source]

Bases: object

convertDistanceToPixels(self, size: float, unit: Qgis.RenderUnit) float[source]

Converts a distance size from the specified units to pixels.

Parameters:
Return type:

float

distanceRange(self) QgsDoubleRange[source]

Returns the range of distances to include in the generation.

Distances outside this range may be excluded from the generation (if it results in faster profile generation).

Return type:

QgsDoubleRange

dpi(self) float[source]

Returns the DPI (dots per inch) for the profie, to be used in size conversions.

See also

setDpi()

Return type:

float

elevationRange(self) QgsDoubleRange[source]

Returns the range of elevations to include in the generation.

Elevations outside this range may be excluded from the generation (if it results in faster profile generation).

Return type:

QgsDoubleRange

mapUnitsPerDistancePixel(self) float[source]

Returns the number of map units per pixel in the distance dimension.

Return type:

float

maximumErrorMapUnits(self) float[source]

Returns the maximum allowed error in the generated result, in profile curve map units.

By default this is NaN, which indicates that the profile should be generated in the highest precision possible. Larger values will result in a faster profile to generate.

Return type:

float

setDistanceRange(self, range: QgsDoubleRange)[source]

Sets the range of distances to include in the generation.

Distances outside this range may be excluded from the generation (if it results in faster profile generation).

See also

distanceRange()

Parameters:

range (QgsDoubleRange)

setDpi(self, dpi: float)[source]

Sets the dpi (dots per inch) for the profie, to be used in size conversions.

See also

dpi()

Parameters:

dpi (float)

setElevationRange(self, range: QgsDoubleRange)[source]

Sets the range of elevations to include in the generation.

Elevations outside this range may be excluded from the generation (if it results in faster profile generation).

See also

elevationRange()

Parameters:

range (QgsDoubleRange)

setMapUnitsPerDistancePixel(self, units: float)[source]

Sets the number of map units per pixel in the distance dimension.

Parameters:

units (float)

setMaximumErrorMapUnits(self, error: float)[source]

Sets the maximum allowed error in the generated result, in profile curve map units.

By default this is NaN, which indicates that the profile should be generated in the highest precision possible. Larger values will result in a faster profile to generate.

Parameters:

error (float)