windkit.check_dead_ends
- windkit.check_dead_ends(lines_out, errors='raise', add_errors=False)[source]
Detects dead ends in a given set of lines.
This function checks for dead ends in the provided GeoDataFrame of lines. A dead end is defined as a point where only one line segment ends or starts.
- Parameters:
lines_out (GeoDataFrame) – A GeoDataFrame containing the line geometries to be checked for dead ends.
errors ({"raise", "warn", "ignore"}, optional) – Specifies how to handle detected crossings: - “raise”: Raises a
ValueError
if crossings are found. - “warn”: Issues a warning if crossings are found. - “ignore”: Does nothing. Default is “raise”.add_errors (bool, optional) – If True, adds a boolean column named “crosses” to the input GeoDataFrame, indicating whether each line crosses another line. Default is True.
- Returns:
The input GeoDataFrame with an optional “crosses” column added if ‘add_errors’ is True.
- Return type:
- Raises:
ValueError – If ‘errors’ is set to “raise” and crossing lines are detected.
- Warns:
UserWarning – If ‘errors’ is set to “warn” and crossing lines are detected.