# NetworkGeometryProcessor { #brdr.processor.NetworkGeometryProcessor }

```python
processor.NetworkGeometryProcessor(config, feedback=None)
```

Processor that aligns geometries based on a linear network.

This processor decomposes polygons into their exterior and interior linear
rings and aligns these boundaries to the linear elements (lines and points)
found in the reference dataset.

## Attributes {.doc-section .doc-section-attributes}

| Name         | Type                                    | Description                                                     |
|--------------|-----------------------------------------|-----------------------------------------------------------------|
| processor_id | [ProcessorID](`brdr.enums.ProcessorID`) | The unique identifier for this processor (ProcessorID.NETWORK). |

## Methods

| Name | Description |
| --- | --- |
| [process](#brdr.processor.NetworkGeometryProcessor.process) | Aligns the boundaries of the input geometry to a reference network. |

### process { #brdr.processor.NetworkGeometryProcessor.process }

```python
processor.NetworkGeometryProcessor.process(
    input_geometry,
    reference_data,
    mitre_limit,
    correction_distance,
    relevant_distance,
    **kwargs,
)
```

Aligns the boundaries of the input geometry to a reference network.

The process buffers the input to find relevant network elements,
processes exterior and interior rings separately, and reconstructs
the polygon after alignment.

#### Parameters {.doc-section .doc-section-parameters}

| Name                | Type                                                                     | Description                                                        | Default    |
|---------------------|--------------------------------------------------------------------------|--------------------------------------------------------------------|------------|
| input_geometry      | [BaseGeometry](`shapely.geometry.base.BaseGeometry`)                     | The thematic geometry (Polygon or MultiPolygon) to align.          | _required_ |
| reference_data      | [AlignerFeatureCollection](`brdr.feature_data.AlignerFeatureCollection`) | The reference dataset, specifically using its `elements` property. | _required_ |
| mitre_limit         | [float](`float`)                                                         | Mitre limit for buffering operations.                              | _required_ |
| correction_distance | [float](`float`)                                                         | Distance used for cleaning and noise reduction.                    | _required_ |
| relevant_distance   | [float](`float`)                                                         | The maximum distance to search for network elements.               | _required_ |
| **kwargs            | [Any](`typing.Any`)                                                      | Additional arguments passed to the processor.                      | `{}`       |

#### Returns {.doc-section .doc-section-returns}

| Name   | Type                                          | Description                                                    |
|--------|-----------------------------------------------|----------------------------------------------------------------|
|        | [ProcessResult](`brdr.typings.ProcessResult`) | A dictionary containing the reconstructed and cleaned polygon. |

#### Notes {.doc-section .doc-section-notes}

The network processing follows a "deconstruct-align-reconstruct" flow:



```{mermaid}
graph TD
    In[Input Polygon] --> Decon[Deconstruct: Exterior & Interiors]
    Decon --> Buff[Buffer Input to Find Network]
    Buff --> Align[Align Segments to Network Elements]
    Align --> Recon[Reconstruct Polygon Rings]
    Recon --> Post[Post-processing & Sliver Removal]
    Post --> End[Final ProcessResult]
```