# gupta-pavitra07/lidarr architecture

> Architecture diagram of the GitHub repository gupta-pavitra07/lidarr, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gupta-pavitra07/lidarr
- Repository: https://github.com/gupta-pavitra07/lidarr

## Overview

This Spring Boot LiDAR processor accepts CSV point clouds, filters and aggregates points into configurable spatial cells, summarizes cell and connected risk-zone statistics, and exports a downloadable CSV. The README also describes an interactive React heatmap frontend, but its source is absent from the supplied tree, so it is represented only as an external client. Edges follow the controller-owned workflow and sampled calls; no frontend-to-backend implementation details are inferred.

Main entry points: [`src/main/java/com/lidar/controller/LidarController.java`](https://github.com/gupta-pavitra07/lidarr/blob/main/src/main/java/com/lidar/controller/LidarController.java) (REST controller), [`src/main/java/com/lidar/processing/GridAggregator.java`](https://github.com/gupta-pavitra07/lidarr/blob/main/src/main/java/com/lidar/processing/GridAggregator.java) (Cell aggregator), [`src/main/java/com/lidar/processing/StatisticsSummarizer.java`](https://github.com/gupta-pavitra07/lidarr/blob/main/src/main/java/com/lidar/processing/StatisticsSummarizer.java) (Risk summarizer), [`src/main/java/com/lidar/export/CsvExporter.java`](https://github.com/gupta-pavitra07/lidarr/blob/main/src/main/java/com/lidar/export/CsvExporter.java) (CSV exporter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API orchestration"]
  node_controller["REST controller"]
end

subgraph group_ingest["Point ingestion"]
  node_reader["CSV reader"]
  node_point["Point record<br/>[Point.java]"]
  node_validator["Point validator<br/>[DataValidator.java]"]
end

subgraph group_spatial["Grid processing"]
  node_partitioner["Grid partitioner"]
  node_aggregator["Cell aggregator"]
  node_coordinate["Grid coordinate"]
  node_cell["Grid cell stats<br/>[GridCell.java]"]
end

subgraph group_results["Analysis and export"]
  node_summarizer["Risk summarizer"]
  node_summary["Summary metrics<br/>[SummaryStats.java]"]
  node_exporter["CSV exporter<br/>[CsvExporter.java]"]
  node_csvfile["Processed CSV"]
end

node_client(("React client"))

node_client -->|"uploads CSV"| node_controller
node_controller -->|"reads upload"| node_reader
node_reader -->|"creates points"| node_point
node_controller -->|"filters points"| node_validator
node_validator -->|"validates fields"| node_point
node_controller -->|"aggregates stream"| node_aggregator
node_aggregator -->|"partitions points"| node_partitioner
node_partitioner -->|"maps coordinates"| node_point
node_partitioner -->|"returns coordinate"| node_coordinate
node_aggregator -->|"indexes cells"| node_coordinate
node_aggregator -->|"updates stats"| node_cell
node_controller -->|"summarizes grid"| node_summarizer
node_summarizer -->|"reads risk stats"| node_cell
node_summarizer -->|"finds adjacent zones"| node_coordinate
node_summarizer -->|"returns metrics"| node_summary
node_controller -->|"exports grid"| node_exporter
node_exporter -->|"reads cell fields"| node_cell
node_exporter -->|"reads grid keys"| node_coordinate
node_exporter -->|"writes CSV"| node_csvfile
node_controller -.->|"returns summary or CSV"| node_client

click node_controller "https://github.com/gupta-pavitra07/lidarr/blob/main/src/main/java/com/lidar/controller/LidarController.java"
click node_reader "https://github.com/gupta-pavitra07/lidarr/blob/main/src/main/java/com/lidar/reader/PointCloudReader.java"
click node_point "https://github.com/gupta-pavitra07/lidarr/blob/main/src/main/java/com/lidar/model/Point.java"
click node_validator "https://github.com/gupta-pavitra07/lidarr/blob/main/src/main/java/com/lidar/validator/DataValidator.java"
click node_partitioner "https://github.com/gupta-pavitra07/lidarr/blob/main/src/main/java/com/lidar/processing/GridPartitioner.java"
click node_aggregator "https://github.com/gupta-pavitra07/lidarr/blob/main/src/main/java/com/lidar/processing/GridAggregator.java"
click node_coordinate "https://github.com/gupta-pavitra07/lidarr/blob/main/src/main/java/com/lidar/model/GridCoordinate.java"
click node_cell "https://github.com/gupta-pavitra07/lidarr/blob/main/src/main/java/com/lidar/model/GridCell.java"
click node_summarizer "https://github.com/gupta-pavitra07/lidarr/blob/main/src/main/java/com/lidar/processing/StatisticsSummarizer.java"
click node_summary "https://github.com/gupta-pavitra07/lidarr/blob/main/src/main/java/com/lidar/processing/SummaryStats.java"
click node_exporter "https://github.com/gupta-pavitra07/lidarr/blob/main/src/main/java/com/lidar/export/CsvExporter.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_controller,node_client toneBlue
class node_reader,node_point,node_validator toneAmber
class node_partitioner,node_aggregator,node_coordinate,node_cell toneMint
class node_summarizer,node_summary,node_exporter,node_csvfile toneRose
```

## Components

### API orchestration

- [REST controller](https://github.com/gupta-pavitra07/lidarr/blob/main/src/main/java/com/lidar/controller/LidarController.java): `src/main/java/com/lidar/controller/LidarController.java`

### Point ingestion

- [CSV reader](https://github.com/gupta-pavitra07/lidarr/blob/main/src/main/java/com/lidar/reader/PointCloudReader.java): `src/main/java/com/lidar/reader/PointCloudReader.java`
- [Point record](https://github.com/gupta-pavitra07/lidarr/blob/main/src/main/java/com/lidar/model/Point.java): `src/main/java/com/lidar/model/Point.java`
- [Point validator](https://github.com/gupta-pavitra07/lidarr/blob/main/src/main/java/com/lidar/validator/DataValidator.java): `src/main/java/com/lidar/validator/DataValidator.java`

### Grid processing

- [Grid partitioner](https://github.com/gupta-pavitra07/lidarr/blob/main/src/main/java/com/lidar/processing/GridPartitioner.java): `src/main/java/com/lidar/processing/GridPartitioner.java`
- [Cell aggregator](https://github.com/gupta-pavitra07/lidarr/blob/main/src/main/java/com/lidar/processing/GridAggregator.java): `src/main/java/com/lidar/processing/GridAggregator.java`
- [Grid coordinate](https://github.com/gupta-pavitra07/lidarr/blob/main/src/main/java/com/lidar/model/GridCoordinate.java): `src/main/java/com/lidar/model/GridCoordinate.java`
- [Grid cell stats](https://github.com/gupta-pavitra07/lidarr/blob/main/src/main/java/com/lidar/model/GridCell.java): `src/main/java/com/lidar/model/GridCell.java`

### Analysis and export

- [Risk summarizer](https://github.com/gupta-pavitra07/lidarr/blob/main/src/main/java/com/lidar/processing/StatisticsSummarizer.java): `src/main/java/com/lidar/processing/StatisticsSummarizer.java`
- [Summary metrics](https://github.com/gupta-pavitra07/lidarr/blob/main/src/main/java/com/lidar/processing/SummaryStats.java): `src/main/java/com/lidar/processing/SummaryStats.java`
- [CSV exporter](https://github.com/gupta-pavitra07/lidarr/blob/main/src/main/java/com/lidar/export/CsvExporter.java): `src/main/java/com/lidar/export/CsvExporter.java`
- **Processed CSV**

### Other components

- **React client**

## Connections

- React client → REST controller: uploads CSV (evidence: `README.md`)
- REST controller → CSV reader: reads upload (evidence: `src/main/java/com/lidar/controller/LidarController.java`)
- CSV reader → Point record: creates points (evidence: `src/main/java/com/lidar/reader/PointCloudReader.java`)
- REST controller → Point validator: filters points (evidence: `src/main/java/com/lidar/controller/LidarController.java`)
- Point validator → Point record: validates fields (evidence: `src/main/java/com/lidar/validator/DataValidator.java`)
- REST controller → Cell aggregator: aggregates stream (evidence: `src/main/java/com/lidar/controller/LidarController.java`)
- Cell aggregator → Grid partitioner: partitions points (evidence: `src/main/java/com/lidar/processing/GridAggregator.java`)
- Grid partitioner → Point record: maps coordinates (evidence: `src/main/java/com/lidar/processing/GridPartitioner.java`)
- Grid partitioner → Grid coordinate: returns coordinate (evidence: `src/main/java/com/lidar/processing/GridPartitioner.java`)
- Cell aggregator → Grid coordinate: indexes cells (evidence: `src/main/java/com/lidar/processing/GridAggregator.java`)
- Cell aggregator → Grid cell stats: updates stats (evidence: `src/main/java/com/lidar/processing/GridAggregator.java`)
- REST controller → Risk summarizer: summarizes grid (evidence: `src/main/java/com/lidar/controller/LidarController.java`)
- Risk summarizer → Grid cell stats: reads risk stats (evidence: `src/main/java/com/lidar/processing/StatisticsSummarizer.java`)
- Risk summarizer → Grid coordinate: finds adjacent zones (evidence: `src/main/java/com/lidar/processing/StatisticsSummarizer.java`)
- Risk summarizer → Summary metrics: returns metrics (evidence: `src/main/java/com/lidar/processing/StatisticsSummarizer.java`)
- REST controller → CSV exporter: exports grid (evidence: `src/main/java/com/lidar/controller/LidarController.java`)
- CSV exporter → Grid cell stats: reads cell fields (evidence: `src/main/java/com/lidar/export/CsvExporter.java`)
- CSV exporter → Grid coordinate: reads grid keys (evidence: `src/main/java/com/lidar/export/CsvExporter.java`)
- CSV exporter → Processed CSV: writes CSV (evidence: `src/main/java/com/lidar/export/CsvExporter.java`)
- REST controller → React client: returns summary or CSV (evidence: `README.md`)
