Class: QgsAbstractTerrainProvider¶
Abstract base class for terrain providers
Added in version 3.26.
Class Hierarchy¶
Subclasses¶
A terrain provider where the terrain is a simple flat surface.  | 
|
A terrain provider that uses the Z values of a mesh layer to build a terrain surface.  | 
|
A terrain provider where the terrain source is a raster DEM layer.  | 
Methods
Creates a clone of the provider and returns the new object.  | 
|
Returns the native coordinate reference system of the terrain provider.  | 
|
Returns   | 
|
Returns the height at the point (x,y) in the terrain provider's native   | 
|
Returns the vertical offset value, used for adjusting the heights from the terrain provider.  | 
|
Called on the main thread prior to accessing the provider from a background thread.  | 
|
Reads common properties from a DOM element.  | 
|
Reads the terrain provider state from a DOM element.  | 
|
Resolves reference to layers from stored layer ID (if it has not been resolved already)  | 
|
Returns the vertical scale factor, which can be used to exaggerate vertical heights.  | 
|
Returns the vertical offset value, used for adjusting the heights from the terrain provider  | 
|
Sets the vertical scale factor, which can be used to exaggerate vertical heights.  | 
|
Returns the unique type ID string for the provider.  | 
|
Writes common properties to a DOM element.  | 
|
Returns a DOM element representing the state of the terrain provider.  | 
- class qgis.core.QgsAbstractTerrainProvider[source]¶
 Bases:
object- clone(self) QgsAbstractTerrainProvider | None[source]¶
 Creates a clone of the provider and returns the new object.
Ownership is transferred to the caller.
- Return type:
 Optional[QgsAbstractTerrainProvider]
- crs(self) QgsCoordinateReferenceSystem[source]¶
 Returns the native coordinate reference system of the terrain provider.
- Return type:
 
- equals(self, other: QgsAbstractTerrainProvider | None) bool[source]¶
 Returns
Trueif the provider is equal toother.- Parameters:
 other (Optional[QgsAbstractTerrainProvider])
- Return type:
 bool
- heightAt(self, x: float, y: float) float[source]¶
 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[source]¶
 Returns the vertical offset value, used for adjusting the heights from the terrain provider.
See also
See also
- Return type:
 float
- prepare(self)[source]¶
 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)[source]¶
 Reads common properties from a DOM
element.- Parameters:
 element (QDomElement)
context (QgsReadWriteContext)
- readXml(self, element: QDomElement, context: QgsReadWriteContext) bool[source]¶
 Reads the terrain provider state from a DOM
element.See also
- Parameters:
 element (QDomElement)
context (QgsReadWriteContext)
- Return type:
 bool
- resolveReferences(self, project: QgsProject | None)[source]¶
 Resolves reference to layers from stored layer ID (if it has not been resolved already)
- Parameters:
 project (Optional[QgsProject])
- scale(self) float[source]¶
 Returns the vertical scale factor, which can be used to exaggerate vertical heights.
See also
See also
- Return type:
 float
- setOffset(self, offset: float)[source]¶
 Returns the vertical
offsetvalue, used for adjusting the heights from the terrain providerSee also
See also
- Parameters:
 offset (float)
- setScale(self, scale: float)[source]¶
 Sets the vertical
scalefactor, which can be used to exaggerate vertical heights.See also
See also
- Parameters:
 scale (float)
- writeCommonProperties(self, element: QDomElement, context: QgsReadWriteContext)[source]¶
 Writes common properties to a DOM
element.- Parameters:
 element (QDomElement)
context (QgsReadWriteContext)
- writeXml(self, document: QDomDocument, context: QgsReadWriteContext) QDomElement[source]¶
 Returns a DOM element representing the state of the terrain provider.
See also
- Parameters:
 document (QDomDocument)
context (QgsReadWriteContext)
- Return type:
 QDomElement