Class: QgsAbstractTerrainProvider

class qgis.core.QgsAbstractTerrainProvider

Bases: sip.wrapper

Abstract base class for terrain providers

New in version 3.26.

QgsAbstractTerrainProvider() Constructor for QgsAbstractTerrainProvider.

Methods

clone

Creates a clone of the provider and returns the new object.

crs

Returns the native coordinate reference system of the terrain provider.

equals

Returns True if the provider is equal to other.

heightAt

Returns the height at the point (x,y) in the terrain provider's native crs().

offset

Returns the vertical offset value, used for adjusting the heights from the terrain provider.

prepare

Called on the main thread prior to accessing the provider from a background thread.

readCommonProperties

Reads common properties from a DOM element.

readXml

Reads the terrain provider state from a DOM element.

resolveReferences

Resolves reference to layers from stored layer ID (if it has not been resolved already)

scale

Returns the vertical scale factor, which can be used to exaggerate vertical heights.

setOffset

Returns the vertical offset value, used for adjusting the heights from the terrain provider

setScale

Sets the vertical scale factor, which can be used to exaggerate vertical heights.

type

Returns the unique type ID string for the provider.

writeCommonProperties

Writes common properties to a DOM element.

writeXml

Returns a DOM element representing the state of the terrain provider.

clone(self) QgsAbstractTerrainProvider

Creates a clone of the provider and returns the new object.

Ownership is transferred to the caller.

Return type:

QgsAbstractTerrainProvider

crs(self) QgsCoordinateReferenceSystem

Returns the native coordinate reference system of the terrain provider.

Return type:

QgsCoordinateReferenceSystem

equals(self, other: QgsAbstractTerrainProvider) bool

Returns True if the provider is equal to other.

Parameters:

other (QgsAbstractTerrainProvider) –

Return type:

bool

heightAt(self, x: float, y: float) float

Returns the height at the point (x,y) in the terrain provider’s native crs().

Returns NaN if the height could not be obtained at the specified point.

Parameters:
  • x (float) –

  • y (float) –

Return type:

float

offset(self) float

Returns the vertical offset value, used for adjusting the heights from the terrain provider.

See also

setOffset()

See also

scale()

Return type:

float

prepare(self)

Called on the main thread prior to accessing the provider from a background thread.

Subclasses must implement suitable logic in order to prepare for thread-safe calculation of terrain heights on background threads.

readCommonProperties(self, element: QDomElement, context: QgsReadWriteContext)

Reads common properties from a DOM element.

Parameters:
readXml(self, element: QDomElement, context: QgsReadWriteContext) bool

Reads the terrain provider state from a DOM element.

See also

writeXml()

Parameters:
Return type:

bool

resolveReferences(self, project: QgsProject)

Resolves reference to layers from stored layer ID (if it has not been resolved already)

Parameters:

project (QgsProject) –

scale(self) float

Returns the vertical scale factor, which can be used to exaggerate vertical heights.

See also

setScale()

See also

offset()

Return type:

float

setOffset(self, offset: float)

Returns the vertical offset value, used for adjusting the heights from the terrain provider

See also

offset()

See also

setScale()

Parameters:

offset (float) –

setScale(self, scale: float)

Sets the vertical scale factor, which can be used to exaggerate vertical heights.

See also

scale()

See also

setOffset()

Parameters:

scale (float) –

type(self) str

Returns the unique type ID string for the provider.

Return type:

str

writeCommonProperties(self, element: QDomElement, context: QgsReadWriteContext)

Writes common properties to a DOM element.

Parameters:
writeXml(self, document: QDomDocument, context: QgsReadWriteContext) QDomElement

Returns a DOM element representing the state of the terrain provider.

See also

readXml()

Parameters:
Return type:

QDomElement