sec_interp.core.domain package
SecInterp Core Domain Package.
This package contains the domain entities, DTOs, and enums that define the core business logic of the plugin, decoupled from QGIS-specific implementation details where possible.
- sec_interp.core.domain.DomainGeometry
alias of
str
- class sec_interp.core.domain.DrillholeTaskInput(line_geometry_wkt: str, line_start_x: float, line_start_y: float, line_crs_authid: str, section_azimuth: float, buffer_width: float, collar_id_field: str, use_geometry: bool, collar_x_field: str, collar_y_field: str, collar_z_field: str, collar_depth_field: str, collar_data: list[dict[str, ~typing.Any]], survey_data: dict[~typing.Any, list[tuple[float, float, float]]], interval_data: dict[~typing.Any, list[tuple[float, float, str]]], pre_sampled_z: dict[~typing.Any, float] = <factory>)
Bases:
objectData Transfer Object for DrillholeGenerationTask.
Encapsulates all data required to project and process drillholes in a background thread without accessing QGIS API objects.
- line_geometry_wkt
Section geometry in WKT.
- Type:
str
- line_start_x
Start vertex X.
- Type:
float
- line_start_y
Start vertex Y.
- Type:
float
- line_crs_authid
CRS of the section line.
- Type:
str
- section_azimuth
Azimuth orientation in degrees.
- Type:
float
- buffer_width
Maximum horizontal projection buffer.
- Type:
float
- collar_id_field
ID field name.
- Type:
str
- use_geometry
Whether to use geometric coordinates for collars.
- Type:
bool
- collar_x_field
Fallback X field name.
- Type:
str
- collar_y_field
Fallback Y field name.
- Type:
str
- collar_z_field
Collar elevation field.
- Type:
str
- collar_depth_field
Total depth field.
- Type:
str
- collar_data
List of detached features.
- Type:
list[dict[str, Any]]
- survey_data
Dictionary mapping hole IDs to survey readings.
- Type:
dict[Any, list[tuple[float, float, float]]]
- interval_data
Dictionary mapping hole IDs to geological logs.
- Type:
dict[Any, list[tuple[float, float, str]]]
- pre_sampled_z
Dictionary of pre-calculated collar elevations.
- Type:
dict[Any, float]
- buffer_width: float
- collar_data: list[dict[str, Any]]
- collar_depth_field: str
- collar_id_field: str
- collar_x_field: str
- collar_y_field: str
- collar_z_field: str
- interval_data: dict[Any, list[tuple[float, float, str]]]
- line_crs_authid: str
- line_geometry_wkt: str
- line_start_x: float
- line_start_y: float
- pre_sampled_z: dict[Any, float]
- section_azimuth: float
- survey_data: dict[Any, list[tuple[float, float, float]]]
- use_geometry: bool
- class sec_interp.core.domain.FieldType(*values)
Bases:
IntEnumCore-safe field types mapping to QVariant.Type values.
This allows the core module to perform type validation WITHOUT direct dependencies on PyQt components.
- BOOL = 1
- DATE = 14
- DATE_TIME = 16
- DOUBLE = 6
- INT = 2
- LONG_LONG = 4
- NULL = 0
- STRING = 10
- class sec_interp.core.domain.GeologySegment(unit_name: str, geometry_wkt: str | None, attributes: dict[str, ~typing.Any], points: list[tuple[float, float]], points_3d: list[tuple[float, float, float]] = <factory>, points_3d_projected: list[tuple[float, float, float]] = <factory>)
Bases:
objectRepresents a geological unit segment along the profile.
- unit_name
Name of the geological unit.
- Type:
str
- geometry_wkt
WKT representation of the segment geometry (optional).
- Type:
str | None
- attributes
Dictionary containing original feature attributes.
- Type:
dict[str, Any]
- points
Sampled points (distance, elevation) representing the segment boundary.
- Type:
list[tuple[float, float]]
- attributes: dict[str, Any]
- geometry_wkt: str | None
- points: list[tuple[float, float]]
- points_3d: list[tuple[float, float, float]]
- points_3d_projected: list[tuple[float, float, float]]
- unit_name: str
- class sec_interp.core.domain.GeologyTaskInput(line_geometry_wkt: str, line_start_x: float, line_start_y: float, crs_authid: str, master_profile_data: list[tuple[float, float]], master_grid_dists: list[tuple[float, tuple[float, float], float]], outcrop_data: list[dict[str, Any]], outcrop_name_field: str, tolerance: float = 0.001)
Bases:
objectData Transfer Object for GeologyGenerationTask.
Contains all necessary data to process geological profiles without accessing QGIS layers directly.
- line_geometry_wkt
Section geometry in WKT format.
- Type:
str
- line_start_x
X coordinate of section start vertex.
- Type:
float
- line_start_y
Y coordinate of section start vertex.
- Type:
float
- crs_authid
Authority ID for the CRS (e.g., ‘EPSG:4326’).
- Type:
str
- master_profile_data
Sampled topography elevations.
- Type:
list[tuple[float, float]]
- master_grid_dists
Grid distances for point sampling.
- Type:
list[tuple[float, tuple[float, float], float]]
- outcrop_data
Detached outcrop features (geometries and attrs).
- Type:
list[dict[str, Any]]
- outcrop_name_field
Name of the field containing unit info.
- Type:
str
- tolerance
Distance tolerance for intersection sampling.
- Type:
float
- crs_authid: str
- line_geometry_wkt: str
- line_start_x: float
- line_start_y: float
- master_grid_dists: list[tuple[float, tuple[float, float], float]]
- master_profile_data: list[tuple[float, float]]
- outcrop_data: list[dict[str, Any]]
- outcrop_name_field: str
- tolerance: float = 0.001
- class sec_interp.core.domain.InterpretationPolygon(id: str, name: str, type: str, vertices_2d: list[tuple[float, float]], attributes: dict[str, ~typing.Any] = <factory>, color: str = '#FF0000', created_at: str = '')
Bases:
objectRepresents a 2D digitized interpretation polygon on the section profile.
- id
Unique identifier for the polygon.
- Type:
str
- name
User-defined name for the interpreted unit/feature.
- Type:
str
- type
Classification (e.g., ‘lithology’, ‘fault’, ‘alteration’).
- Type:
str
- vertices_2d
List of (distance, elevation) points defining the polygon.
- Type:
list[tuple[float, float]]
- attributes
Metadata for the interpretation.
- Type:
dict[str, Any]
- color
Visual representation color (HEX).
- Type:
str
- created_at
ISO timestamp of creation.
- Type:
str
- attributes: dict[str, Any]
- color: str = '#FF0000'
- created_at: str = ''
- id: str
- name: str
- type: str
- vertices_2d: list[tuple[float, float]]
- class sec_interp.core.domain.InterpretationPolygon25D(id: str, name: str, type: str, geometry_wkt: str, attributes: dict[str, Any], crs_authid: str)
Bases:
objectRepresents a georeferenced 2.5D interpretation geometry (with M coordinates).
- id
Inherited identifier.
- Type:
str
- name
Inherited name.
- Type:
str
- type
Inherited type.
- Type:
str
- geometry_wkt
Domain Geometry in WKT format.
- Type:
str
- attributes
Inherited and calculated attributes.
- Type:
dict[str, Any]
- crs_authid
CRS Auth ID (e.g. ‘EPSG:4326’).
- Type:
str
- attributes: dict[str, Any]
- crs_authid: str
- geometry_wkt: str
- id: str
- name: str
- type: str
- class sec_interp.core.domain.PreviewParams(raster_layer: str, line_layer: str, band_num: int, buffer_dist: float = 100.0, outcrop_layer: str | None = None, outcrop_name_field: str | None = None, struct_layer: str | None = None, dip_field: str | None = None, strike_field: str | None = None, dip_scale_factor: float = 1.0, collar_layer: str | None = None, collar_id_field: str | None = None, collar_use_geometry: bool = True, collar_x_field: str | None = None, collar_y_field: str | None = None, collar_z_field: str | None = None, collar_depth_field: str | None = None, survey_layer: str | None = None, survey_id_field: str | None = None, survey_depth_field: str | None = None, survey_azim_field: str | None = None, survey_incl_field: str | None = None, interval_layer: str | None = None, interval_id_field: str | None = None, interval_from_field: str | None = None, interval_to_field: str | None = None, interval_lith_field: str | None = None, max_points: int = 1000, canvas_width: int = 800, auto_lod: bool = True)
Bases:
objectConsolidated parameters for profile generation and preview.
- raster_layer
QGIS layer ID for DEM sampling.
- Type:
str
- line_layer
QGIS layer ID for the section orientation.
- Type:
str
- band_num
Raster band number to use for elevation.
- Type:
int
- buffer_dist
Search buffer for projecting data onto the section.
- Type:
float
- outcrop_layer
Optional layer ID with geological outcrops.
- Type:
str | None
- outcrop_name_field
Field name for geological unit names.
- Type:
str | None
- struct_layer
Optional layer ID with structural measurements.
- Type:
str | None
- dip_field
Field name for dip values.
- Type:
str | None
- strike_field
Field name for strike/azimuth values.
- Type:
str | None
- dip_scale_factor
Visual scale factor for dip lines.
- Type:
float
- collar_layer
Optional layer ID with drillhole collars.
- Type:
str | None
- collar_id_field
Field name for drillhole IDs in collar layer.
- Type:
str | None
- collar_use_geometry
Whether to use layer geometry for collar coordinates.
- Type:
bool
- collar_x_field
Field name for X coordinate.
- Type:
str | None
- collar_y_field
Field name for Y coordinate.
- Type:
str | None
- collar_z_field
Field name for Z coordinate.
- Type:
str | None
- collar_depth_field
Field name for total hole depth.
- Type:
str | None
- survey_layer
Optional layer ID with drillhole surveys.
- Type:
str | None
- survey_id_field
Field name for drillhole IDs in survey layer.
- Type:
str | None
- survey_depth_field
Field name for downhole depth in survey.
- Type:
str | None
- survey_azim_field
Field name for azimuth in survey.
- Type:
str | None
- survey_incl_field
Field name for inclination in survey.
- Type:
str | None
- interval_layer
Optional layer ID with drillhole intervals.
- Type:
str | None
- interval_id_field
Field name for drillhole IDs in interval layer.
- Type:
str | None
- interval_from_field
Field name for ‘from’ depth.
- Type:
str | None
- interval_to_field
Field name for ‘to’ depth.
- Type:
str | None
- interval_lith_field
Field name for lithology code/name.
- Type:
str | None
- max_points
Max number of points for simplified preview (LOD).
- Type:
int
- canvas_width
Width of the preview canvas in pixels.
- Type:
int
- auto_lod
Whether to automatically adjust LOD based on canvas width.
- Type:
bool
- auto_lod: bool = True
- band_num: int
- buffer_dist: float = 100.0
- canvas_width: int = 800
- collar_depth_field: str | None = None
- collar_id_field: str | None = None
- collar_layer: str | None = None
- collar_use_geometry: bool = True
- collar_x_field: str | None = None
- collar_y_field: str | None = None
- collar_z_field: str | None = None
- dip_field: str | None = None
- dip_scale_factor: float = 1.0
- interval_from_field: str | None = None
- interval_id_field: str | None = None
- interval_layer: str | None = None
- interval_lith_field: str | None = None
- interval_to_field: str | None = None
- line_layer: str
- max_points: int = 1000
- outcrop_layer: str | None = None
- outcrop_name_field: str | None = None
- raster_layer: str
- strike_field: str | None = None
- struct_layer: str | None = None
- survey_azim_field: str | None = None
- survey_depth_field: str | None = None
- survey_id_field: str | None = None
- survey_incl_field: str | None = None
- survey_layer: str | None = None
- validate() None
Perform native validation of parameters.
- Raises:
ValidationError – If critical parameters are missing or invalid.
- class sec_interp.core.domain.PreviewResult(topo: list[tuple[float, float]] | None=None, geol: list[GeologySegment] | None = None, struct: list[StructureMeasurement] | None = None, drillhole: Any | None = None, metrics: MetricsCollector = <factory>, buffer_dist: float = 0.0)
Bases:
objectConsolidated result set from profile generation.
- topo
Sampled topographic profile data.
- Type:
list[tuple[float, float]] | None
- geol
List of geological unit segments.
- Type:
list[sec_interp.core.domain.entities.GeologySegment] | None
- struct
List of projected structural measurements.
- Type:
list[sec_interp.core.domain.entities.StructureMeasurement] | None
- drillhole
Processed drillhole projection data.
- Type:
Any | None
- metrics
Performance metrics collector for the generation cycle.
- buffer_dist
Buffer distance used for this result.
- Type:
float
- buffer_dist: float = 0.0
- drillhole: Any | None = None
- geol: list[GeologySegment] | None = None
- get_distance_range() tuple[float, float]
Calculate the horizontal distance range based on topography.
Uses the first and last points of the sampled topography as the authoritative horizontal bounds of the section.
- Returns:
A tuple containing (min_distance, max_distance).
- get_elevation_range() tuple[float, float]
Calculate the global minimum and maximum elevation across all active layers.
Scans topography, geology, structural measurements, and drillhole data to find the absolute vertical bounds.
- Returns:
A tuple containing (min_elevation, max_elevation).
- metrics: MetricsCollector
- struct: list[StructureMeasurement] | None = None
- topo: list[tuple[float, float]] | None = None
- class sec_interp.core.domain.SpatialMeta(hole_id: str | None = None, dist_along: float = 0.0, offset: float = 0.0, z: float = 0.0, x_3d: float | None = None, y_3d: float | None = None, x_proj: float | None = None, y_proj: float | None = None, norm_x: float | None = None, norm_y: float | None = None, attributes: dict[str, Any] | None = None)
Bases:
objectCarrying spatial metadata for 3D/2D decoupling.
This DTO acts as a universal bridge between raw spatial data and various renderers (2D profiling or 3D engines), carrying coordinates, normalization vectors, and original attributes without layer dependencies.
- hole_id
Unique identifier for the drillhole.
- Type:
str | None
- dist_along
Distance along the section line (station).
- Type:
float
- offset
Orthogonal distance from the section line.
- Type:
float
- z
Elevation or vertical coordinate.
- Type:
float
- x_3d
X coordinate in global 3D space.
- Type:
float | None
- y_3d
Y coordinate in global 3D space.
- Type:
float | None
- norm_x
Normalized X component of the orientation vector.
- Type:
float | None
- norm_y
Normalized Y component of the orientation vector.
- Type:
float | None
- attributes
Original feature attributes for contextual display.
- Type:
dict[str, Any] | None
- attributes: dict[str, Any] | None = None
- dist_along: float = 0.0
- hole_id: str | None = None
- norm_x: float | None = None
- norm_y: float | None = None
- offset: float = 0.0
- to_vec2_profile() tuple[float, float]
Convert spatial data to a 2D profile vector (Distance, Z).
- to_vec3() tuple[float, float, float]
Convert spatial data to a 3D vector tuple (X, Y, Z).
- x_3d: float | None = None
- x_proj: float | None = None
- y_3d: float | None = None
- y_proj: float | None = None
- z: float = 0.0
- class sec_interp.core.domain.StructureMeasurement(distance: float, elevation: float, apparent_dip: float, original_dip: float, original_strike: float, attributes: dict[str, Any])
Bases:
objectRepresents a projected structural measurement on the section plane.
- distance
Horizontal distance from the start of the profile.
- Type:
float
- elevation
Elevation (Z) at the projected point.
- Type:
float
- apparent_dip
Dip angle relative to the section plane.
- Type:
float
- original_dip
True dip measured in the field.
- Type:
float
- original_strike
True strike (azimuth) measured in the field.
- Type:
float
- attributes
Dictionary containing original feature attributes.
- Type:
dict[str, Any]
- apparent_dip: float
- attributes: dict[str, Any]
- distance: float
- elevation: float
- original_dip: float
- original_strike: float
Submodules
- sec_interp.core.domain.dtos module
PreviewParamsPreviewParams.raster_layerPreviewParams.line_layerPreviewParams.band_numPreviewParams.buffer_distPreviewParams.outcrop_layerPreviewParams.outcrop_name_fieldPreviewParams.struct_layerPreviewParams.dip_fieldPreviewParams.strike_fieldPreviewParams.dip_scale_factorPreviewParams.collar_layerPreviewParams.collar_id_fieldPreviewParams.collar_use_geometryPreviewParams.collar_x_fieldPreviewParams.collar_y_fieldPreviewParams.collar_z_fieldPreviewParams.collar_depth_fieldPreviewParams.survey_layerPreviewParams.survey_id_fieldPreviewParams.survey_depth_fieldPreviewParams.survey_azim_fieldPreviewParams.survey_incl_fieldPreviewParams.interval_layerPreviewParams.interval_id_fieldPreviewParams.interval_from_fieldPreviewParams.interval_to_fieldPreviewParams.interval_lith_fieldPreviewParams.max_pointsPreviewParams.canvas_widthPreviewParams.auto_lodPreviewParams.auto_lodPreviewParams.band_numPreviewParams.buffer_distPreviewParams.canvas_widthPreviewParams.collar_depth_fieldPreviewParams.collar_id_fieldPreviewParams.collar_layerPreviewParams.collar_use_geometryPreviewParams.collar_x_fieldPreviewParams.collar_y_fieldPreviewParams.collar_z_fieldPreviewParams.dip_fieldPreviewParams.dip_scale_factorPreviewParams.interval_from_fieldPreviewParams.interval_id_fieldPreviewParams.interval_layerPreviewParams.interval_lith_fieldPreviewParams.interval_to_fieldPreviewParams.line_layerPreviewParams.max_pointsPreviewParams.outcrop_layerPreviewParams.outcrop_name_fieldPreviewParams.raster_layerPreviewParams.strike_fieldPreviewParams.struct_layerPreviewParams.survey_azim_fieldPreviewParams.survey_depth_fieldPreviewParams.survey_id_fieldPreviewParams.survey_incl_fieldPreviewParams.survey_layerPreviewParams.validate()
PreviewResultPreviewResult.topoPreviewResult.geolPreviewResult.structPreviewResult.drillholePreviewResult.metricsPreviewResult.buffer_distPreviewResult.buffer_distPreviewResult.drillholePreviewResult.geolPreviewResult.get_distance_range()PreviewResult.get_elevation_range()PreviewResult.metricsPreviewResult.structPreviewResult.topo
- sec_interp.core.domain.entities module
DomainGeometryExportSettingsGeologySegmentInterpretationPolygonInterpretationPolygon.idInterpretationPolygon.nameInterpretationPolygon.typeInterpretationPolygon.vertices_2dInterpretationPolygon.attributesInterpretationPolygon.colorInterpretationPolygon.created_atInterpretationPolygon.attributesInterpretationPolygon.colorInterpretationPolygon.created_atInterpretationPolygon.idInterpretationPolygon.nameInterpretationPolygon.typeInterpretationPolygon.vertices_2d
InterpretationPolygon25DInterpretationPolygon25D.idInterpretationPolygon25D.nameInterpretationPolygon25D.typeInterpretationPolygon25D.geometry_wktInterpretationPolygon25D.attributesInterpretationPolygon25D.crs_authidInterpretationPolygon25D.attributesInterpretationPolygon25D.crs_authidInterpretationPolygon25D.geometry_wktInterpretationPolygon25D.idInterpretationPolygon25D.nameInterpretationPolygon25D.type
LayerDictPoint2DPoint3DPointListSettingsDictStructureMeasurementStructureMeasurement.distanceStructureMeasurement.elevationStructureMeasurement.apparent_dipStructureMeasurement.original_dipStructureMeasurement.original_strikeStructureMeasurement.attributesStructureMeasurement.apparent_dipStructureMeasurement.attributesStructureMeasurement.distanceStructureMeasurement.elevationStructureMeasurement.original_dipStructureMeasurement.original_strike
ValidationResult
- sec_interp.core.domain.enums module
- sec_interp.core.domain.spatial_meta module
SpatialMetaSpatialMeta.hole_idSpatialMeta.dist_alongSpatialMeta.offsetSpatialMeta.zSpatialMeta.x_3dSpatialMeta.y_3dSpatialMeta.norm_xSpatialMeta.norm_ySpatialMeta.attributesSpatialMeta.attributesSpatialMeta.dist_alongSpatialMeta.hole_idSpatialMeta.norm_xSpatialMeta.norm_ySpatialMeta.offsetSpatialMeta.to_vec2_profile()SpatialMeta.to_vec3()SpatialMeta.x_3dSpatialMeta.x_projSpatialMeta.y_3dSpatialMeta.y_projSpatialMeta.z
- sec_interp.core.domain.task_inputs module
DrillholeTaskInputDrillholeTaskInput.line_geometry_wktDrillholeTaskInput.line_start_xDrillholeTaskInput.line_start_yDrillholeTaskInput.line_crs_authidDrillholeTaskInput.section_azimuthDrillholeTaskInput.buffer_widthDrillholeTaskInput.collar_id_fieldDrillholeTaskInput.use_geometryDrillholeTaskInput.collar_x_fieldDrillholeTaskInput.collar_y_fieldDrillholeTaskInput.collar_z_fieldDrillholeTaskInput.collar_depth_fieldDrillholeTaskInput.collar_dataDrillholeTaskInput.survey_dataDrillholeTaskInput.interval_dataDrillholeTaskInput.pre_sampled_zDrillholeTaskInput.buffer_widthDrillholeTaskInput.collar_dataDrillholeTaskInput.collar_depth_fieldDrillholeTaskInput.collar_id_fieldDrillholeTaskInput.collar_x_fieldDrillholeTaskInput.collar_y_fieldDrillholeTaskInput.collar_z_fieldDrillholeTaskInput.interval_dataDrillholeTaskInput.line_crs_authidDrillholeTaskInput.line_geometry_wktDrillholeTaskInput.line_start_xDrillholeTaskInput.line_start_yDrillholeTaskInput.pre_sampled_zDrillholeTaskInput.section_azimuthDrillholeTaskInput.survey_dataDrillholeTaskInput.use_geometry
GeologyTaskInputGeologyTaskInput.line_geometry_wktGeologyTaskInput.line_start_xGeologyTaskInput.line_start_yGeologyTaskInput.crs_authidGeologyTaskInput.master_profile_dataGeologyTaskInput.master_grid_distsGeologyTaskInput.outcrop_dataGeologyTaskInput.outcrop_name_fieldGeologyTaskInput.toleranceGeologyTaskInput.crs_authidGeologyTaskInput.line_geometry_wktGeologyTaskInput.line_start_xGeologyTaskInput.line_start_yGeologyTaskInput.master_grid_distsGeologyTaskInput.master_profile_dataGeologyTaskInput.outcrop_dataGeologyTaskInput.outcrop_name_fieldGeologyTaskInput.tolerance