sec_interp.gui.adapters.geology_extractor module
Geology extraction adapter (Extract phase).
Bridges the QGIS object world and the QGIS-agnostic core layer for geological
profiles. It reads the section line and outcrop layers, densifies and samples
the master profile, and intersects the section line with outcrop polygons —
returning a fully-detached GeologyContext so GeologyService never
touches QGIS objects.
- class sec_interp.gui.adapters.geology_extractor.GeologyExtractor
Bases:
objectExtract geological data from QGIS layers into a QGIS-agnostic context.
- extract_context(line_lyr: qgis.core.QgsVectorLayer, raster_lyr: qgis.core.QgsRasterLayer, outcrop_lyr: qgis.core.QgsVectorLayer, outcrop_name_field: str, band_number: int = 1, feature_id: int | None = None, smoothing_window_m: float = 0.0) GeologyContext
Extract all geology data into a detached
GeologyContext.- Parameters:
line_lyr – The cross-section line vector layer.
raster_lyr – The DEM raster layer.
outcrop_lyr – The geological outcrop vector layer.
outcrop_name_field – Attribute field name for unit names.
band_number – Raster band to use for elevation sampling.
feature_id – Section feature id (first feature when
None).smoothing_window_m – Smoothing window (m) applied to the master profile so the geology follows the smoothed topography.
- Returns:
A fully-detached
GeologyContext.
- tr(message: str) str
Translate a message using QCoreApplication.