Class: QgsMapLayerElevationProperties¶
Base class for storage of map layer elevation properties.
QgsMapLayerElevationProperties exposes user-configurable
settings for controlling how an individual QgsMapLayer
behaves with relation to z values or elevations.
Added in version 3.18.
Note
This is an abstract class, with methods which must be implemented by a subclass.
The following methods must be implemented: clone(), readXml(), writeXml()
Class Hierarchy¶
Base classes¶
Subclasses¶
Mesh layer specific subclass of |
|
Point cloud layer specific subclass of |
|
Raster layer specific subclass of |
|
Tiled scene layer specific subclass of |
|
Vector layer specific subclass of |
- class qgis.core.QgsMapLayerElevationProperties[source]¶
Bases:
QObject- __init__(parent: QObject | None)
Constructor for QgsMapLayerElevationProperties, with the specified
parentobject.- Parameters:
parent (Optional[QObject])
- class Flag¶
Bases:
int
- FlagDontInvalidateCachedRendersWhenRangeChanges = 1¶
- class Flags¶
- class Flags(f: QgsMapLayerElevationProperties.Flags | QgsMapLayerElevationProperties.Flag)
- class Flags(a0: QgsMapLayerElevationProperties.Flags)
Bases:
object
- class Property(*values)¶
Bases:
IntEnumData definable properties.
Added in version 3.26.
ZOffset: Z offsetExtrusionHeight: Extrusion heightRasterPerBandLowerElevation: Lower elevation for each raster bandAdded in version 3.38.
RasterPerBandUpperElevation: Upper elevation for each raster bandAdded in version 3.38.
- virtual calculateZRange(self, layer: QgsMapLayer | None) QgsDoubleRange[source]¶
Attempts to calculate the overall elevation or z range for the specified
layer, using the settings defined by this elevation properties object.May return an infinite range if the extent could not be calculated.
- Parameters:
layer (Optional[QgsMapLayer])
- Return type:
- signal changed[source]¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- abstract clone(self) QgsMapLayerElevationProperties | None[source]¶
Creates a clone of the properties.
Added in version 3.26.
- Return type:
Optional[QgsMapLayerElevationProperties]
- copyCommonProperties(self, other: QgsMapLayerElevationProperties | None)[source]¶
Copies common properties from another object.
Added in version 3.26.
- Parameters:
other (Optional[QgsMapLayerElevationProperties])
- dataDefinedProperties(self) QgsPropertyCollection¶
Returns a reference to the object’s property collection, used for data defined overrides.
See also
Added in version 3.26.
- Return type:
- virtual flags(self) QgsMapLayerElevationProperties.Flags[source]¶
Returns flags associated to the elevation properties.
- Return type:
- virtual hasElevation(self) bool[source]¶
Returns
Trueif the layer has an elevation or z component.- Return type:
bool
- virtual htmlSummary(self) str[source]¶
Returns a HTML formatted summary of the properties.
Added in version 3.26.
- Return type:
str
- virtual isVisibleInZRange(self, range: QgsDoubleRange, layer: QgsMapLayer | None = None) bool[source]¶
Returns
Trueif the layer should be visible and rendered for the specified zrange.Since QGIS 3.38 the
layerargument can be used to specify the target layer.- Parameters:
range (QgsDoubleRange)
layer (Optional[QgsMapLayer] = None)
- Return type:
bool
- signal profileGenerationPropertyChanged[source]¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- signal profileRenderingPropertyChanged[source]¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- static propertyDefinitions() Dict[int, QgsPropertyDefinition][source]¶
Returns the definitions for data defined properties available for use in elevation properties.
Added in version 3.26.
- Return type:
Dict[int, QgsPropertyDefinition]
- readCommonProperties(self, element: QDomElement, context: QgsReadWriteContext)[source]¶
Reads common class properties from a DOM
elementpreviously written bywriteXml().See also
Added in version 3.26.
- Parameters:
element (QDomElement)
context (QgsReadWriteContext)
- abstract readXml(self, element: QDomElement, context: QgsReadWriteContext) bool[source]¶
Reads the elevation properties from a DOM
elementpreviously written bywriteXml().See also
- Parameters:
element (QDomElement)
context (QgsReadWriteContext)
- Return type:
bool
- setDataDefinedProperties(self, collection: QgsPropertyCollection)[source]¶
Sets the object’s property
collection, used for data defined overrides.Any existing properties will be discarded.
See also
See also
Property
Added in version 3.26.
- Parameters:
collection (QgsPropertyCollection)
- virtual setDefaultsFromLayer(self, layer: QgsMapLayer | None)[source]¶
Sets default properties based on sensible choices for the given map
layer.Added in version 3.26.
- Parameters:
layer (Optional[QgsMapLayer])
- setZOffset(self, offset: float)[source]¶
Sets the z
offset, which is a fixed offset amount which will be added to z values from the layer.See also
- Parameters:
offset (float)
- setZScale(self, scale: float)[source]¶
Sets the z
scale, which is a scaling factor which will be applied to z values from the layer.This can be used to correct or manually adjust for incorrect elevation values in a layer, such as conversion of elevation values in feet to meters.
See also
- Parameters:
scale (float)
- virtual showByDefaultInElevationProfilePlots(self) bool[source]¶
Returns
Trueif the layer should be visible by default in newly created elevation profile plots.Subclasses should override this with logic which determines whether the layer is likely desirable to be initially checked in these plots.
Added in version 3.26.
- Return type:
bool
- virtual significantZValues(self, layer: QgsMapLayer | None) List[float]¶
Returns a list of significant elevation/z-values for the specified
layer, using the settings defined by this elevation properties object.These values will be highlighted in elevation related widgets for the layer.
Added in version 3.38.
- Parameters:
layer (Optional[QgsMapLayer])
- Return type:
List[float]
- writeCommonProperties(self, element: QDomElement, doc: QDomDocument, context: QgsReadWriteContext)[source]¶
Writes common class properties to a DOM
element, to be used later withreadXml().See also
Added in version 3.26.
- Parameters:
element (QDomElement)
doc (QDomDocument)
context (QgsReadWriteContext)
- abstract writeXml(self, element: QDomElement, doc: QDomDocument, context: QgsReadWriteContext) QDomElement[source]¶
Writes the properties to a DOM
element, to be used later withreadXml().See also
- Parameters:
element (QDomElement)
doc (QDomDocument)
context (QgsReadWriteContext)
- Return type:
QDomElement
- zOffset(self) float[source]¶
Returns the z offset, which is a fixed offset amount which should be added to z values from the layer.
See also
- Return type:
float
- signal zOffsetChanged[source]¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- zScale(self) float[source]¶
Returns the z scale, which is a scaling factor which should be applied to z values from the layer.
This can be used to correct or manually adjust for incorrect elevation values in a layer, such as conversion of elevation values in feet to meters.
See also
- Return type:
float
- signal zScaleChanged[source]¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.