# shubhagarwal-03/geo-reconciliation architecture

> Architecture diagram of the GitHub repository shubhagarwal-03/geo-reconciliation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shubhagarwal-03/geo-reconciliation
- Repository: https://github.com/shubhagarwal-03/geo-reconciliation

## Overview

LandLens is a geospatial building-footprint reconciliation product: an offline batch workflow ingests independent sources, normalizes and matches footprints, reconciles conflicts, scores confidence, and stores canonical entities; the live application displays those results and lets operators review or resolve uncertain entities. The frontend also documents upload, map, dashboard, and reporting capabilities. The README and sampled files establish the main batch and query paths; some unsampled router and view wiring is represented only where the documented API or product capability supports it.

Main entry points: [`pipeline/run_offline_batch.py`](https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/pipeline/run_offline_batch.py) (Offline batch), [`frontend/src/api/geoReconciliationClient.ts`](https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/frontend/src/api/geoReconciliationClient.ts) (API client), [`frontend/src/App.tsx`](https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/frontend/src/App.tsx) (Frontend application), [`db/connection.py`](https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/db/connection.py) (PostGIS data store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Ingestion and pipeline"]
  node_batch["Offline batch"]
  node_osmfetch["OSM ingestion"]
  node_googlefetch["Google Buildings ingestion"]
  node_uploadfetch["Uploaded-file ingestion"]
end

subgraph group_engine["Matching and reconciliation"]
  node_normalize["Normalize features<br/>[normalize.py]"]
  node_matching["Spatial matching<br/>[match_entities.py]"]
  node_similarity["Similarity scoring<br/>[similarity.py]"]
  node_resolve["Conflict resolution"]
  node_confidence["Confidence and review routing"]
end

subgraph group_service["API and spatial data"]
  node_db[("PostGIS data store<br/>[connection.py]")]
  node_api["FastAPI application<br/>[main.py]"]
  node_entities["Entity queries<br/>[entities.py]"]
  node_reviewapi["Review queue<br/>[review_queue.py]"]
  node_uploadapi["Upload endpoint<br/>[upload.py]"]
  node_reconcileapi["Reconcile endpoint<br/>[reconcile.py]"]
end

subgraph group_ui["LandLens interface"]
  node_app["Frontend application<br/>[App.tsx]"]
  node_live["Live data loader"]
  node_client["API client"]
  node_dashboard["Dashboard and map<br/>[DashboardView.tsx]"]
  node_uploadview["Data upload view<br/>[DataUploadView.tsx]"]
  node_reviewview["Review queue view"]
  node_reports["Reports view<br/>[ReportsView.tsx]"]
end

node_operator(("LandLens operator"))
node_osmservice{{"OpenStreetMap"}}
node_googleservice{{"Google Earth Engine"}}

node_osmfetch -->|"fetches footprints"| node_osmservice
node_googlefetch -->|"fetches footprints"| node_googleservice
node_batch -->|"fetches"| node_osmfetch
node_batch -->|"fetches"| node_googlefetch
node_batch -.->|"optionally fetches"| node_uploadfetch
node_batch -->|"normalizes and inserts"| node_normalize
node_normalize -->|"writes raw features"| node_db
node_batch -->|"runs matching"| node_matching
node_matching -->|"scores candidates"| node_similarity
node_matching -->|"reads features, writes edges"| node_db
node_batch -->|"reconciles clusters"| node_resolve
node_batch -->|"scores entities"| node_confidence
node_confidence -->|"writes canonical entities"| node_db
node_api -->|"registers routes"| node_entities
node_api -->|"registers routes"| node_reviewapi
node_api -->|"registers routes"| node_uploadapi
node_api -->|"registers routes"| node_reconcileapi
node_entities -->|"queries entities"| node_db
node_reviewapi -->|"queries flagged entities"| node_db
node_uploadapi -->|"records upload"| node_db
node_reconcileapi -->|"triggers batch run"| node_batch
node_app -->|"loads buildings"| node_live
node_app -->|"renders dashboard"| node_dashboard
node_app -->|"renders upload"| node_uploadview
node_app -->|"renders review"| node_reviewview
node_app -->|"renders reports"| node_reports
node_live -->|"requests entities"| node_client
node_client -->|"calls entity API"| node_entities
node_client -->|"calls review API"| node_reviewapi
node_uploadview -->|"uploads file"| node_client
node_client -->|"calls upload API"| node_uploadapi
node_client -->|"triggers reconciliation"| node_reconcileapi
node_reviewview -->|"submits resolution"| node_client
node_client -->|"resolves entity"| node_entities
node_operator -->|"uses"| node_app

click node_batch "https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/pipeline/run_offline_batch.py"
click node_osmfetch "https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/ingestion/fetch_osm_buildings.py"
click node_googlefetch "https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/ingestion/fetch_google_open_buildings.py"
click node_uploadfetch "https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/ingestion/fetch_uploaded_file.py"
click node_normalize "https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/matching/normalize.py"
click node_matching "https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/matching/match_entities.py"
click node_similarity "https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/matching/similarity.py"
click node_resolve "https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/reconciliation/resolve_conflicts.py"
click node_confidence "https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/reconciliation/confidence_score.py"
click node_db "https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/db/connection.py"
click node_api "https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/backend/main.py"
click node_entities "https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/backend/routers/entities.py"
click node_reviewapi "https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/backend/routers/review_queue.py"
click node_uploadapi "https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/backend/routers/upload.py"
click node_reconcileapi "https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/backend/routers/reconcile.py"
click node_app "https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/frontend/src/App.tsx"
click node_live "https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/frontend/src/hooks/useLiveBuildings.ts"
click node_client "https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/frontend/src/api/geoReconciliationClient.ts"
click node_dashboard "https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/frontend/src/components/DashboardView.tsx"
click node_uploadview "https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/frontend/src/components/DataUploadView.tsx"
click node_reviewview "https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/frontend/src/components/ReviewQueueView.tsx"
click node_reports "https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/frontend/src/components/ReportsView.tsx"

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_batch,node_osmfetch,node_googlefetch,node_uploadfetch toneBlue
class node_normalize,node_matching,node_similarity,node_resolve,node_confidence toneAmber
class node_db,node_api,node_entities,node_reviewapi,node_uploadapi,node_reconcileapi toneMint
class node_app,node_live,node_client,node_dashboard,node_uploadview,node_reviewview,node_reports toneRose
class node_operator,node_osmservice,node_googleservice toneIndigo
```

## Components

### Ingestion and pipeline

- [Offline batch](https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/pipeline/run_offline_batch.py): `pipeline/run_offline_batch.py`
- [OSM ingestion](https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/ingestion/fetch_osm_buildings.py): `ingestion/fetch_osm_buildings.py`
- [Google Buildings ingestion](https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/ingestion/fetch_google_open_buildings.py): `ingestion/fetch_google_open_buildings.py`
- [Uploaded-file ingestion](https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/ingestion/fetch_uploaded_file.py): `ingestion/fetch_uploaded_file.py`

### Matching and reconciliation

- [Normalize features](https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/matching/normalize.py): `matching/normalize.py`
- [Spatial matching](https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/matching/match_entities.py): `matching/match_entities.py`
- [Similarity scoring](https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/matching/similarity.py): `matching/similarity.py`
- [Conflict resolution](https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/reconciliation/resolve_conflicts.py): `reconciliation/resolve_conflicts.py`
- [Confidence and review routing](https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/reconciliation/confidence_score.py): `reconciliation/confidence_score.py`

### API and spatial data

- [PostGIS data store](https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/db/connection.py): `db/connection.py`
- [FastAPI application](https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/backend/main.py): `backend/main.py`
- [Entity queries](https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/backend/routers/entities.py): `backend/routers/entities.py`
- [Review queue](https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/backend/routers/review_queue.py): `backend/routers/review_queue.py`
- [Upload endpoint](https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/backend/routers/upload.py): `backend/routers/upload.py`
- [Reconcile endpoint](https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/backend/routers/reconcile.py): `backend/routers/reconcile.py`

### LandLens interface

- [Frontend application](https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Live data loader](https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/frontend/src/hooks/useLiveBuildings.ts): `frontend/src/hooks/useLiveBuildings.ts`
- [API client](https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/frontend/src/api/geoReconciliationClient.ts): `frontend/src/api/geoReconciliationClient.ts`
- [Dashboard and map](https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/frontend/src/components/DashboardView.tsx): `frontend/src/components/DashboardView.tsx`
- [Data upload view](https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/frontend/src/components/DataUploadView.tsx): `frontend/src/components/DataUploadView.tsx`
- [Review queue view](https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/frontend/src/components/ReviewQueueView.tsx): `frontend/src/components/ReviewQueueView.tsx`
- [Reports view](https://github.com/shubhagarwal-03/geo-reconciliation/blob/master/frontend/src/components/ReportsView.tsx): `frontend/src/components/ReportsView.tsx`

### Other components

- **LandLens operator**
- **OpenStreetMap**
- **Google Earth Engine**

## Connections

- OSM ingestion → OpenStreetMap: fetches footprints
- Google Buildings ingestion → Google Earth Engine: fetches footprints
- Offline batch → OSM ingestion: fetches
- Offline batch → Google Buildings ingestion: fetches
- Offline batch → Uploaded-file ingestion: optionally fetches
- Offline batch → Normalize features: normalizes and inserts
- Normalize features → PostGIS data store: writes raw features
- Offline batch → Spatial matching: runs matching
- Spatial matching → Similarity scoring: scores candidates
- Spatial matching → PostGIS data store: reads features, writes edges
- Offline batch → Conflict resolution: reconciles clusters
- Offline batch → Confidence and review routing: scores entities
- Confidence and review routing → PostGIS data store: writes canonical entities
- FastAPI application → Entity queries: registers routes
- FastAPI application → Review queue: registers routes
- FastAPI application → Upload endpoint: registers routes
- FastAPI application → Reconcile endpoint: registers routes
- Entity queries → PostGIS data store: queries entities
- Review queue → PostGIS data store: queries flagged entities
- Upload endpoint → PostGIS data store: records upload
- Reconcile endpoint → Offline batch: triggers batch run
- Frontend application → Live data loader: loads buildings
- Frontend application → Dashboard and map: renders dashboard
- Frontend application → Data upload view: renders upload
- Frontend application → Review queue view: renders review
- Frontend application → Reports view: renders reports
- Live data loader → API client: requests entities
- API client → Entity queries: calls entity API
- API client → Review queue: calls review API
- Data upload view → API client: uploads file
- API client → Upload endpoint: calls upload API
- API client → Reconcile endpoint: triggers reconciliation
- Review queue view → API client: submits resolution
- API client → Entity queries: resolves entity
- LandLens operator → Frontend application: uses
