# sec_interp.core.services.drillhole.collar_processor module

Processing logic for Drillhole Collars.

class sec_interp.core.services.drillhole.collar_processor.CollarProcessor

  Bases: `object`

  Handles extraction and projection of collar data.

  DEFAULT_BUFFER_SEGMENTS = 8
  build_coordinate_map(collar_data: list[dict[str, Any]], use_geometry: bool, collar_x_field: str, collar_y_field: str) → dict[Any, qgis.core.QgsPointXY]

    Build a mapping of hole IDs to collar coordinates.

  detach_features(layer: QgsVectorLayer, line_geom: QgsGeometry, buffer_width: float, id_field: str, use_geom: bool, x_field: str, y_field: str, z_field: str, dem_layer: QgsRasterLayer | None, target_crs: QgsCoordinateReferenceSystem | None = None, transform_context: Any | None = None) → tuple[set[Any], list[dict[str, Any]], dict[Any, float]]

    Detach collar features and pre-sample Z using WKT for decoupling.

  extract_and_project_detached(collar_data: dict[str, Any] | QgsFeature, line_geom: QgsGeometry, line_start: QgsPointXY, da: QgsDistanceArea, 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, pre_sampled_z: dict[Any, float] | None = None, dem_layer: QgsRasterLayer | None = None) → DrillholeProjection | None

    Process and project a single collar from either dict or feature.

  extract_attributes_agnostic(data: dict[str, Any] | QgsFeature, id_field: str, use_geometry: bool, x_field: str, y_field: str, z_field: str, depth_field: str, pre_sampled_z: dict[Any, float] | None = None, dem_layer: QgsRasterLayer | None = None) → tuple[Any, QgsPointXY, float, float] | None

    Extract collar ID, coordinate, Z and depth agnosticly from dict or feature.

  extract_point_agnostic(data: Any, is_dict: bool, use_geom: bool, x_f: str, y_f: str) → QgsPointXY | None

    Extract point from geometry or fields agnosticly.

  pre_sample_z(feat: qgis.core.QgsFeature, hydro_id: Any, dem_layer: qgis.core.QgsRasterLayer, z_field: str, use_geom: bool, x_field: str, y_field: str) → float | None

    Sample Z from DEM if missing in features.