# sec_interp.core.utils.geometry_utils.extraction module

Geometry extraction utilities.

sec_interp.core.utils.geometry_utils.extraction.extract_all_vertices(geometry: qgis.core.QgsGeometry) → list[qgis.core.QgsPointXY]

  Extract all vertices from any QGIS geometry type.

  Parameters:

    geometry – The input QGIS geometry.

  Returns:

    A flat list of all vertices found in the geometry.

sec_interp.core.utils.geometry_utils.extraction.extract_lines_from_geometry(geometry: qgis.core.QgsGeometry) → list[qgis.core.QgsGeometry]

  Extract individual LineString geometries from a (possibly Multi) geometry.

  If the input is a MultiLineString, it decomposes it into its constituent parts. If it’s a single LineString, it returns it in a list.

  Parameters:

    geometry – Input geometry (LineString or MultiLineString).

sec_interp.core.utils.geometry_utils.extraction.get_line_vertices(geometry: qgis.core.QgsGeometry) → list[qgis.core.QgsPointXY]

  Extract vertices specifically from a line or multiline geometry.

  Parameters:

    geometry – A QGIS geometry of type LineGeometry.

  Returns:

    A flat list of vertices.

  Raises:

    ValueError – If the geometry is null, not a line, or contains no vertices.