sec_interp.gui.adapters.drillhole_extractor module

Drillhole extraction adapter (Extract phase).

Bridges the QGIS object world and the QGIS-agnostic core layer for drillholes. It reads the section line and collar layers, buffers the line, detaches collars, pre-samples collar elevations from a DEM, and fetches survey/interval data — returning a fully-detached DrillholeContext.

class sec_interp.gui.adapters.drillhole_extractor.DrillholeExtractor(data_fetcher: Any | None = None)

Bases: object

Extract drillhole-related data from QGIS layers into primitives.

__init__(data_fetcher: Any | None = None) → None

Initialize with an optional child-data fetcher.

Parameters:

data_fetcher – A DataFetcher adapter for survey/interval bulk reads.

extract_context(line_layer: QgsVectorLayer, buffer_width: float, collar_layer: QgsVectorLayer, collar_id_field: str, use_geometry: bool, collar_x_field: str, collar_y_field: str, collar_z_field: str, collar_depth_field: str, survey_layer: QgsVectorLayer, survey_fields: dict[str, str], interval_layer: QgsVectorLayer, interval_fields: dict[str, str], dem_layer: QgsRasterLayer | None = None, band_num: int = 1, feature_id: int | None = None) → DrillholeContext | None

Extract a fully-detached DrillholeContext.

Parameters:
  • line_layer – The cross-section line layer.

  • buffer_width – Buffer distance (line-layer units).

  • collar_layer – Collar points layer.

  • collar_id_field – ID field name.

  • use_geometry – Whether to read collar coordinates from geometry.

  • collar_x_field – Fallback X field.

  • collar_y_field – Fallback Y field.

  • collar_z_field – Collar elevation field.

  • collar_depth_field – Total depth field.

  • survey_layer – Survey readings layer.

  • survey_fields – Survey field mapping.

  • interval_layer – Interval layer.

  • interval_fields – Interval field mapping.

  • dem_layer – Optional DEM for fallback collar elevation.

  • band_num – Raster band for elevation sampling.

  • feature_id – Section feature id (first feature when None).

Returns:

A detached DrillholeContext, or None if no line geometry.

tr(message: str) → str

Translate a message using QCoreApplication.