# 1 - Topological arc ```{container} algorithm-id **Algorithm ID**: `hedgetools:topologicalarc` ``` This tool takes polygon geometries and generates their median axis by pruning the skeleton created from Voronoi polygons. Two parameters control the pruning process: *dangle length* and *minimum width*. ```{container} parameter Dangle length ``` This parameter defines the length threshold below which a dangle is removed.
A dangle is a line segment that starts from a node with a degree of 3 or more and ends at a terminal node (an extremity).
The slider below shows the influence of the dangle length on the median axis. ```{container} slider-parameter Dangle length (meters): ``` ```{raw} html
10
``` ```{admonition} Explanation :class: remarque The initial image shows the skeleton of a polygon. Increasing the dangle length progressively removes smaller branches. At the highest dangle length, even valid extremities are removed. ``` ```{container} parameter Minimal width ``` This parameter defines the interval between polygon vertices (densification). Smaller values generate more vertices, increasing processing time, but allow the median axis to pass through narrow polygon edges without being disconnected.
When multiple disconnected lines are found in a polygon (usually due to narrow edges), the longest line is used as the valid median axis, and the others are placed in the error layer. You can manually merge the disconnected lines, but ensure that you remain inside the polygon boundaries and maintain unique `eid` values. ```{container} slider-parameter Minimal width (meters): ``` ```{raw} html
2
``` ```{admonition} Explanation :class: remarque The initial image shows the median axis of a polygon. Increasing the densification value progressively makes the median axis more jagged until it becomes disconnected. ``` ```{admonition} Warning :class: warning The default value of `-1` sets the densification interval automatically. For optimization, if the automatic value is below 2 meters, it is capped at 2 meters.
You can manually input a lower value, but be aware that processing time will increase dramatically. ``` ## Parameters | Label | Name | Type | Description | |-------|------|------|-------------| | Input polygon layer | `INPUT` | [vector: polygon] | Polygon vector layer to create the median axis on. | | Dangle length threshold (meters) | `THRESHOLD` | [numeric: double]
Default: 30.0 | Value for dangle deletion (see dangle length above) | | Minimal width (meters) | `MIN_WIDTH` | [numeric: double]
Default: -1.0 | Minimal width value (see minimal width above) | | Output polygon layer | `OUTPUT_POLY` | [vector: polygon]
Default: `[Create temporary layer]` | Output polygon vector layer | | Output arc layer | `OUTPUT_ARC` | [vector: line]
Default: `[Create temporary layer]` | Output line vector layer | | Output error layer | `OUTPUT_ERROR` | [vector: line]
Default: `[Create temporary layer]` | Output line vector layer | ## Outputs | Label | Name | Type | Description | |-------|------|------|-------------| | Output polygon layer | `OUTPUT_POLY` | [vector: polygon] | Polygon vector layer with updated `pid` (PK) and `is_hedge` field. The `is_hedge` field is set to `False` when a complex line network is detected within a polygon. This indicates to the user that the feature may have been incorrectly classified as a hedge. | | Output arc layer | `OUTPUT_ARC` | [vector: line] | Line vector layer of the main median axis with an `eid` (PK) and a `pid` (FK) field. | | Output error layer | `OUTPUT_ERROR` | [vector: line] | Line vector layer of the disconnected median axis. |