sec_interp.gui.preview_layer_factory module

class sec_interp.gui.preview_layer_factory.PreviewLayerFactory[source]

Bases: object

Factory for creating and styling QGIS memory layers for the preview.

GEOLOGY_COLORS: ClassVar[list[qgis.PyQt.QtGui.QColor]] = [qgis.PyQt.QtGui.QColor, qgis.PyQt.QtGui.QColor, qgis.PyQt.QtGui.QColor, qgis.PyQt.QtGui.QColor, qgis.PyQt.QtGui.QColor, qgis.PyQt.QtGui.QColor, qgis.PyQt.QtGui.QColor, qgis.PyQt.QtGui.QColor, qgis.PyQt.QtGui.QColor, qgis.PyQt.QtGui.QColor, qgis.PyQt.QtGui.QColor, qgis.PyQt.QtGui.QColor, qgis.PyQt.QtGui.QColor, qgis.PyQt.QtGui.QColor, qgis.PyQt.QtGui.QColor, qgis.PyQt.QtGui.QColor]
__init__()[source]

Initialize the layer factory.

create_drillhole_interval_layer(drillhole_data: list, vert_exag: float = 1.0) QgsVectorLayer | None[source]

Create temporary layer for drillhole intervals.

create_drillhole_trace_layer(drillhole_data: list, vert_exag: float = 1.0) QgsVectorLayer | None[source]

Create temporary layer for drillhole traces.

create_geol_layer(geol_data: GeologyData, vert_exag: float = 1.0, max_points: int = 1000) QgsVectorLayer | None[source]

Create temporary layer for geological profile.

create_memory_layer(geometry_type: str, name: str, fields: str | None = None) tuple[QgsVectorLayer | None, Any][source]

Create a memory layer with an unknown CRS.

Parameters:
  • geometry_type – “Point”, “LineString”, “Polygon”

  • name – Layer display name

  • fields – Optional field definition string (e.g., “field=id:integer”)

Returns:

Tuple of (QgsVectorLayer, QgsDataProvider) or (None, None) if failed

create_struct_layer(struct_data: StructureData, reference_data: ProfileData, vert_exag: float = 1.0, dip_line_length: float | None = None) QgsVectorLayer | None[source]

Create temporary layer for structural dips.

create_topo_fill_layer(topo_data: ProfileData, vert_exag: float = 1.0, max_points: int = 1000, base_elevation: float | None = None) QgsVectorLayer | None[source]

Create a solid ‘curtain’ fill layer under the topography for depth.

create_topo_layer(topo_data: ProfileData, vert_exag: float = 1.0, max_points: int = 1000, use_adaptive_sampling: bool = False) QgsVectorLayer | None[source]

Create temporary layer for topographic profile with polychromatic elevation styling.

get_color_for_unit(name: str) qgis.PyQt.QtGui.QColor[source]

Get a consistent color for a geological unit based on its name.

interpolate_elevation(reference_data: list[tuple[float, float]], target_dist: float) float[source]

Interpolate elevation at a given distance.