sec_interp.core.services.geology_service module
- class sec_interp.core.services.geology_service.GeologyService[source]
Bases:
IGeologyServiceService for generating geological profiles.
This service handles the extraction of geological unit intersections along a cross-section line.
- generate_geological_profile(line_lyr: qgis.core.QgsVectorLayer, raster_lyr: qgis.core.QgsRasterLayer, outcrop_lyr: qgis.core.QgsVectorLayer, outcrop_name_field: str, band_number: int = 1) list[GeologySegment][source]
Generate geological profile data by intersecting the section line with outcrop polygons.
Extracts geological unit intersections along the cross-section line, calculates elevations from the DEM, and returns a list of segments.
- Parameters:
line_lyr – The QGIS vector layer representing the cross-section line.
raster_lyr – The Digital Elevation Model (DEM) raster layer.
outcrop_lyr – The QGIS vector layer containing geological outcrop polygons.
outcrop_name_field – The attribute field name for geological unit names.
band_number – The raster band to use for elevation sampling (default 1).
- Returns:
A list of GeologySegment objects, sorted by distance along the section.
- Return type:
GeologyData
- Raises:
DataMissingError – If the line layer has no features.
GeometryError – If the line geometry is invalid.
ProcessingError – If the intersection processing fails.
- prepare_task_input(line_lyr: qgis.core.QgsVectorLayer, raster_lyr: qgis.core.QgsRasterLayer, outcrop_lyr: qgis.core.QgsVectorLayer, outcrop_name_field: str, band_number: int = 1) GeologyTaskInput[source]
Prepare detached domain data for background task.
- process_task_data(task_input: GeologyTaskInput, feedback: Any | None = None) list[GeologySegment][source]
Process geological data in a thread-safe way (Domain-Pure logic).