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
Creates a clone of the provider and returns the new object.
Returns the native coordinate reference system of the terrain provider.
Returns
True
if the provider is equal toother
.Returns the height at the point (x,y) in the terrain provider's native
crs()
.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 providerSets 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.
- clone(self) QgsAbstractTerrainProvider ¶
Creates a clone of the provider and returns the new object.
Ownership is transferred to the caller.
- Return type:
- crs(self) QgsCoordinateReferenceSystem ¶
Returns the native coordinate reference system of the terrain provider.
- Return type:
- equals(self, other: QgsAbstractTerrainProvider) bool ¶
Returns
True
if the provider is equal toother
.- 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
See also
- 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:
element (QDomElement) –
context (QgsReadWriteContext) –
- readXml(self, element: QDomElement, context: QgsReadWriteContext) bool ¶
Reads the terrain provider state from a DOM
element
.See also
- Parameters:
element (QDomElement) –
context (QgsReadWriteContext) –
- 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
See also
- Return type:
float
- setOffset(self, offset: float)¶
Returns the vertical
offset
value, used for adjusting the heights from the terrain providerSee also
See also
- Parameters:
offset (float) –
- setScale(self, scale: float)¶
Sets the vertical
scale
factor, which can be used to exaggerate vertical heights.See also
See also
- 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:
element (QDomElement) –
context (QgsReadWriteContext) –
- writeXml(self, document: QDomDocument, context: QgsReadWriteContext) QDomElement ¶
Returns a DOM element representing the state of the terrain provider.
See also
- Parameters:
document (QDomDocument) –
context (QgsReadWriteContext) –
- Return type:
QDomElement