sec_interp.core.services.geology_service module¶
- class sec_interp.core.services.geology_service.GeologyService¶
Bases:
objectService 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]¶
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:
ValueError – If the line layer has no features or invalid geometry.
RuntimeError – If the intersection processing fails.