# mgthala5-286/agriculture-mapathathon architecture

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

- Interactive diagram: https://gitdiagram.com/mgthala5-286/agriculture-mapathathon
- Repository: https://github.com/mgthala5-286/agriculture-mapathathon

## Overview

This repository screens paddy and banana crops and potential flood impacts for two areas in Tirunelveli, then presents indicators for farm planning. The local workflow analyzes multi-date imagery into crop patches and change/flood summaries, which the dashboard generator uses to create an interactive map. Separate Google Earth Engine workflows provide map-based crop analysis and a richer interactive app, including radar, water, phenology, validation, and inspection-priority layers. Source excerpts show some local writes and dashboard reads; unsampled details and connections between the independent workflows are not inferred.

Main entry points: [`create_dashboard.py`](https://github.com/mgthala5-286/agriculture-mapathathon/blob/main/create_dashboard.py) (Dashboard generator), [`analyze_tirunelveli.py`](https://github.com/mgthala5-286/agriculture-mapathathon/blob/main/analyze_tirunelveli.py) (Local analysis), [`outputs/tirunelveli_crop_parcels.geojson`](https://github.com/mgthala5-286/agriculture-mapathathon/blob/main/outputs/tirunelveli_crop_parcels.geojson) (Crop patches), [`outputs/tirunelveli_change_summary.json`](https://github.com/mgthala5-286/agriculture-mapathathon/blob/main/outputs/tirunelveli_change_summary.json) (Change summary)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_local["Local screening"]
  node_local_analysis["Local analysis"]
end

subgraph group_gee_mapping["Earth Engine mapping"]
  node_gee_crop["Crop mapping workflow"]
end

subgraph group_gee_app["Earth Engine app"]
  node_gee_app["Interactive GEE app"]
end

subgraph group_presentation["Results and dashboard"]
  node_crop_patches["Crop patches"]
  node_change_summary["Change summary"]
  node_flood_summary["Flood summary"]
  node_phenology["Phenology results"]
  node_dashboard_builder["Dashboard generator"]
  node_dashboard["Farm dashboard"]
end

node_farm_manager(("Farm manager"))
node_earth_engine{{"Earth Engine"}}

node_local_analysis -->|"writes patches"| node_crop_patches
node_local_analysis -->|"writes summary"| node_change_summary
node_local_analysis -->|"writes summary"| node_flood_summary
node_local_analysis -.->|"writes results"| node_phenology
node_crop_patches -->|"reads patches"| node_dashboard_builder
node_change_summary -->|"reads summary"| node_dashboard_builder
node_flood_summary -->|"reads summary"| node_dashboard_builder
node_phenology -->|"reads results"| node_dashboard_builder
node_dashboard_builder -->|"generates HTML"| node_dashboard
node_farm_manager -->|"opens dashboard"| node_dashboard
node_earth_engine -.->|"provides imagery"| node_gee_crop
node_earth_engine -->|"provides imagery"| node_gee_app
node_farm_manager -->|"uses app"| node_gee_app

click node_local_analysis "https://github.com/mgthala5-286/agriculture-mapathathon/blob/main/analyze_tirunelveli.py"
click node_crop_patches "https://github.com/mgthala5-286/agriculture-mapathathon/blob/main/outputs/tirunelveli_crop_parcels.geojson"
click node_change_summary "https://github.com/mgthala5-286/agriculture-mapathathon/blob/main/outputs/tirunelveli_change_summary.json"
click node_flood_summary "https://github.com/mgthala5-286/agriculture-mapathathon/blob/main/outputs/tirunelveli_flood_impact_summary.json"
click node_phenology "https://github.com/mgthala5-286/agriculture-mapathathon/blob/main/outputs/tirunelveli_phenology.json"
click node_dashboard_builder "https://github.com/mgthala5-286/agriculture-mapathathon/blob/main/create_dashboard.py"
click node_dashboard "https://github.com/mgthala5-286/agriculture-mapathathon/blob/main/outputs/tirunelveli_dashboard.html"
click node_gee_crop "https://github.com/mgthala5-286/agriculture-mapathathon/blob/main/gee_tirunelveli_crop_mapping.js"
click node_gee_app "https://github.com/mgthala5-286/agriculture-mapathathon/blob/main/gee_tirunelveli_dashboard_app.js"

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_local_analysis toneBlue
class node_gee_crop toneAmber
class node_gee_app toneMint
class node_crop_patches,node_change_summary,node_flood_summary,node_phenology,node_dashboard_builder,node_dashboard toneRose
class node_farm_manager,node_earth_engine toneIndigo
```

## Components

### Local screening

- [Local analysis](https://github.com/mgthala5-286/agriculture-mapathathon/blob/main/analyze_tirunelveli.py): `analyze_tirunelveli.py`

### Earth Engine mapping

- [Crop mapping workflow](https://github.com/mgthala5-286/agriculture-mapathathon/blob/main/gee_tirunelveli_crop_mapping.js): `gee_tirunelveli_crop_mapping.js`

### Earth Engine app

- [Interactive GEE app](https://github.com/mgthala5-286/agriculture-mapathathon/blob/main/gee_tirunelveli_dashboard_app.js): `gee_tirunelveli_dashboard_app.js`

### Results and dashboard

- [Crop patches](https://github.com/mgthala5-286/agriculture-mapathathon/blob/main/outputs/tirunelveli_crop_parcels.geojson): `outputs/tirunelveli_crop_parcels.geojson`
- [Change summary](https://github.com/mgthala5-286/agriculture-mapathathon/blob/main/outputs/tirunelveli_change_summary.json): `outputs/tirunelveli_change_summary.json`
- [Flood summary](https://github.com/mgthala5-286/agriculture-mapathathon/blob/main/outputs/tirunelveli_flood_impact_summary.json): `outputs/tirunelveli_flood_impact_summary.json`
- [Phenology results](https://github.com/mgthala5-286/agriculture-mapathathon/blob/main/outputs/tirunelveli_phenology.json): `outputs/tirunelveli_phenology.json`
- [Dashboard generator](https://github.com/mgthala5-286/agriculture-mapathathon/blob/main/create_dashboard.py): `create_dashboard.py`
- [Farm dashboard](https://github.com/mgthala5-286/agriculture-mapathathon/blob/main/outputs/tirunelveli_dashboard.html): `outputs/tirunelveli_dashboard.html`

### Other components

- **Farm manager**
- **Earth Engine**

## Connections

- Local analysis → Crop patches: writes patches (evidence: `analyze_tirunelveli.py`)
- Local analysis → Change summary: writes summary (evidence: `analyze_tirunelveli.py`)
- Local analysis → Flood summary: writes summary (evidence: `analyze_tirunelveli.py`)
- Local analysis → Phenology results: writes results
- Crop patches → Dashboard generator: reads patches (evidence: `create_dashboard.py`)
- Change summary → Dashboard generator: reads summary (evidence: `create_dashboard.py`)
- Flood summary → Dashboard generator: reads summary (evidence: `create_dashboard.py`)
- Phenology results → Dashboard generator: reads results (evidence: `create_dashboard.py`)
- Dashboard generator → Farm dashboard: generates HTML (evidence: `README.md`)
- Farm manager → Farm dashboard: opens dashboard (evidence: `README.md`)
- Earth Engine → Crop mapping workflow: provides imagery
- Earth Engine → Interactive GEE app: provides imagery (evidence: `gee_tirunelveli_dashboard_app.js`)
- Farm manager → Interactive GEE app: uses app (evidence: `README.md`)
