# Grid
```{container} algorithm-id
**Algorithm ID**: `hedgetools:grid`
```
This tool takes a polygonal grid layer and summarize the hedges in each cell of the grid with various indicator.
The grid layer can be created using QGIS [native:creategrid](https://docs.qgis.org/3.40/en/docs/user_manual/processing_algs/qgis/vectorcreation.html#create-grid) algorithm.
## Parameters
| Label | Name | Type | Description |
|-------|------|------|-------------|
| Input grid layer | `INPUT_GRID` | [vector: polygon] | Polygon vector layer representing the analysis grid. |
| Available metrics | `METRICS` | [enumeration] | Metrics to compute. Available metrics are:
- 0: **Sum of O nodes** – Count of degree 1 nodes.
- 1: **Sum of L nodes** – Count of degree 2 nodes.
- 2: **Sum of T nodes** – Count of degree 3 nodes.
- 3: **Sum of X nodes** – Count of degree 4 nodes.
- 4: **Sum of M nodes** – Count of degree 5+ nodes.
- 5: **Icon** – Connectivity index – weighted sum of hedge intersections.
- 6: **Icoh (%)** – Consistency index – percentage of hedge extremities connected to other hedges and forest/groves.
- 7: **Density (ml/ha)** – Total hedge length per hectare.
- 8: **Density (%)** – Percentage of hedge coverage within each grid cell.
- 9: **Icod** – Bocage density and structure index.
- 10: **Total length** – Sum of arc lengths within each grid cell.
|
| Arc layer | `INPUT_ARC` | [vector: line]
Optional | Line vector layer of the median axis. Required for **Density (ml/ha)** and **Total length** metrics. |
| Node layer | `INPUT_NODE` | [vector: point]
Optional | Point vector layer of hedge extremities. Required for **Sum of***, **Icoh**, and **Icod** metrics. |
| Polygon layer | `INPUT_POLYGON` | [vector: polygon]
Optional | Polygon vector layer of hedges. Required for **Density (%)** and **Icod** metrics. |
| Node type field | `NODE_TYPE` | [field: string]
Optional | Field in the node layer describing node type. Required for **Sum of** metrics. |
| Distance to forest field | `FOREST_FIELD` | [field: string]
Optional | Field in the node layer describing the distance to the closest forest. Required for **Icoh** and **Icod** metrics. |
| Output grid layer | `OUTPUT` | [vector: polygon]
Default: `[Create temporary layer]` | Output polygon vector layer |
## Outputs
| Label | Name | Type | Description |
|-------|------|------|-------------|
| Output grid layer | `OUTPUT` | [vector: polygon] | Grid polygon layer with computed metrics added as new fields. |