# madeshchkma/lulckit architecture

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

- Interactive diagram: https://gitdiagram.com/madeshchkma/lulckit
- Repository: https://github.com/madeshchkma/lulckit

## Overview

LULCkit turns GeoTIFF inputs into inspected profiles, classified or styled rasters, and GIS-ready reports and maps. Its primary workflow is CLI input → profile/model selection → windowed inference → artifact generation. Separate capabilities include band/index operations, clipping, batch and guided workflows, a browser studio, and a hosted Gradio app. The graph follows README capabilities and shown imports/calls; some unsampled subsystem connections are omitted or marked unverified.

Main entry points: [`src/lulckit/cli.py`](https://github.com/madeshchkma/lulckit/blob/main/src/lulckit/cli.py) (CLI workflows), [`spaces/app.py`](https://github.com/madeshchkma/lulckit/blob/main/spaces/app.py) (Hosted Gradio app), [`src/lulckit/models/router.py`](https://github.com/madeshchkma/lulckit/blob/main/src/lulckit/models/router.py) (Model routing), [`src/lulckit/tiling.py`](https://github.com/madeshchkma/lulckit/blob/main/src/lulckit/tiling.py) (Windowed inference)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User interfaces"]
  node_cli["CLI workflows<br/>[cli.py]"]
  node_browser["Browser studio<br/>[app.js]"]
  node_spaces["Hosted Gradio app<br/>[app.py]"]
end

subgraph group_analysis["Raster analysis"]
  node_inspect["Raster profiling<br/>[inspect.py]"]
  node_geo["Geospatial math<br/>[geo.py]"]
  node_bands["Bands and indices<br/>[bands.py]"]
  node_clip["GeoJSON clipping<br/>[bands.py]"]
end

subgraph group_models["Classification models"]
  node_router["Model routing<br/>[router.py]"]
  node_base["Model interface<br/>[base.py]"]
  node_categorical["Categorical pass-through<br/>[categorical.py]"]
  node_segformer["HF SegFormer<br/>[hf_segformer.py]"]
  node_dynamic["Dynamic World<br/>[s2_dw.py]"]
  node_tiling["Windowed inference<br/>[tiling.py]"]
end

subgraph group_products["Map products"]
  node_outputs["Reports and vectors<br/>[outputs.py]"]
  node_cartography["Print and web maps<br/>[cartography.py]"]
  node_artifacts[("GIS-ready files")]
end

node_user(("Raster user"))

node_user -->|"runs commands"| node_cli
node_cli -->|"profiles rasters"| node_inspect
node_cli -->|"selects model"| node_router
node_cli -->|"runs band tools"| node_bands
node_cli -->|"clips rasters"| node_clip
node_cli -->|"runs inference"| node_tiling
node_cli -->|"builds reports"| node_outputs
node_router -->|"instantiates"| node_categorical
node_router -->|"instantiates"| node_segformer
node_router -->|"instantiates"| node_dynamic
node_categorical -->|"implements"| node_base
node_segformer -->|"implements"| node_base
node_dynamic -->|"implements"| node_base
node_tiling -->|"uses math"| node_geo
node_tiling -.->|"uses model API"| node_base
node_tiling -->|"writes rasters"| node_artifacts
node_outputs -->|"writes reports"| node_artifacts
node_cartography -->|"exports maps"| node_artifacts
node_user -->|"opens studio"| node_browser
node_user -->|"opens app"| node_spaces
node_spaces -.->|"profiles uploads"| node_inspect
node_spaces -.->|"offers band tools"| node_bands
node_spaces -.->|"offers map export"| node_cartography

click node_cli "https://github.com/madeshchkma/lulckit/blob/main/src/lulckit/cli.py"
click node_browser "https://github.com/madeshchkma/lulckit/blob/main/docs/app.js"
click node_spaces "https://github.com/madeshchkma/lulckit/blob/main/spaces/app.py"
click node_inspect "https://github.com/madeshchkma/lulckit/blob/main/src/lulckit/inspect.py"
click node_geo "https://github.com/madeshchkma/lulckit/blob/main/src/lulckit/geo.py"
click node_bands "https://github.com/madeshchkma/lulckit/blob/main/src/lulckit/bands.py"
click node_clip "https://github.com/madeshchkma/lulckit/blob/main/src/lulckit/bands.py"
click node_router "https://github.com/madeshchkma/lulckit/blob/main/src/lulckit/models/router.py"
click node_base "https://github.com/madeshchkma/lulckit/blob/main/src/lulckit/models/base.py"
click node_categorical "https://github.com/madeshchkma/lulckit/blob/main/src/lulckit/models/categorical.py"
click node_segformer "https://github.com/madeshchkma/lulckit/blob/main/src/lulckit/models/hf_segformer.py"
click node_dynamic "https://github.com/madeshchkma/lulckit/blob/main/src/lulckit/models/s2_dw.py"
click node_tiling "https://github.com/madeshchkma/lulckit/blob/main/src/lulckit/tiling.py"
click node_outputs "https://github.com/madeshchkma/lulckit/blob/main/src/lulckit/outputs.py"
click node_cartography "https://github.com/madeshchkma/lulckit/blob/main/src/lulckit/cartography.py"

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_cli,node_browser,node_spaces,node_user toneBlue
class node_inspect,node_geo,node_bands,node_clip toneAmber
class node_router,node_base,node_categorical,node_segformer,node_dynamic,node_tiling toneMint
class node_outputs,node_cartography,node_artifacts toneRose
```

## Components

### User interfaces

- [CLI workflows](https://github.com/madeshchkma/lulckit/blob/main/src/lulckit/cli.py): `src/lulckit/cli.py`
- [Browser studio](https://github.com/madeshchkma/lulckit/blob/main/docs/app.js): `docs/app.js`
- [Hosted Gradio app](https://github.com/madeshchkma/lulckit/blob/main/spaces/app.py): `spaces/app.py`

### Raster analysis

- [Raster profiling](https://github.com/madeshchkma/lulckit/blob/main/src/lulckit/inspect.py): `src/lulckit/inspect.py`
- [Geospatial math](https://github.com/madeshchkma/lulckit/blob/main/src/lulckit/geo.py): `src/lulckit/geo.py`
- [Bands and indices](https://github.com/madeshchkma/lulckit/blob/main/src/lulckit/bands.py): `src/lulckit/bands.py`
- [GeoJSON clipping](https://github.com/madeshchkma/lulckit/blob/main/src/lulckit/bands.py): `src/lulckit/bands.py`

### Classification models

- [Model routing](https://github.com/madeshchkma/lulckit/blob/main/src/lulckit/models/router.py): `src/lulckit/models/router.py`
- [Model interface](https://github.com/madeshchkma/lulckit/blob/main/src/lulckit/models/base.py): `src/lulckit/models/base.py`
- [Categorical pass-through](https://github.com/madeshchkma/lulckit/blob/main/src/lulckit/models/categorical.py): `src/lulckit/models/categorical.py`
- [HF SegFormer](https://github.com/madeshchkma/lulckit/blob/main/src/lulckit/models/hf_segformer.py): `src/lulckit/models/hf_segformer.py`
- [Dynamic World](https://github.com/madeshchkma/lulckit/blob/main/src/lulckit/models/s2_dw.py): `src/lulckit/models/s2_dw.py`
- [Windowed inference](https://github.com/madeshchkma/lulckit/blob/main/src/lulckit/tiling.py): `src/lulckit/tiling.py`

### Map products

- [Reports and vectors](https://github.com/madeshchkma/lulckit/blob/main/src/lulckit/outputs.py): `src/lulckit/outputs.py`
- [Print and web maps](https://github.com/madeshchkma/lulckit/blob/main/src/lulckit/cartography.py): `src/lulckit/cartography.py`
- **GIS-ready files**

### Other components

- **Raster user**

## Connections

- Raster user → CLI workflows: runs commands (evidence: `README.md`)
- CLI workflows → Raster profiling: profiles rasters (evidence: `src/lulckit/cli.py`)
- CLI workflows → Model routing: selects model (evidence: `src/lulckit/cli.py`)
- CLI workflows → Bands and indices: runs band tools (evidence: `src/lulckit/cli.py`)
- CLI workflows → GeoJSON clipping: clips rasters (evidence: `README.md`)
- CLI workflows → Windowed inference: runs inference (evidence: `src/lulckit/cli.py`)
- CLI workflows → Reports and vectors: builds reports (evidence: `src/lulckit/cli.py`)
- Model routing → Categorical pass-through: instantiates (evidence: `src/lulckit/models/router.py`)
- Model routing → HF SegFormer: instantiates (evidence: `src/lulckit/models/router.py`)
- Model routing → Dynamic World: instantiates (evidence: `src/lulckit/models/router.py`)
- Categorical pass-through → Model interface: implements (evidence: `src/lulckit/models/categorical.py`)
- HF SegFormer → Model interface: implements (evidence: `src/lulckit/models/hf_segformer.py`)
- Dynamic World → Model interface: implements (evidence: `src/lulckit/models/s2_dw.py`)
- Windowed inference → Geospatial math: uses math (evidence: `src/lulckit/tiling.py`)
- Windowed inference → Model interface: uses model API (evidence: `src/lulckit/tiling.py`)
- Windowed inference → GIS-ready files: writes rasters (evidence: `README.md`)
- Reports and vectors → GIS-ready files: writes reports (evidence: `README.md`)
- Print and web maps → GIS-ready files: exports maps (evidence: `README.md`)
- Raster user → Browser studio: opens studio (evidence: `README.md`)
- Raster user → Hosted Gradio app: opens app (evidence: `README.md`)
- Hosted Gradio app → Raster profiling: profiles uploads (evidence: `spaces/app.py`)
- Hosted Gradio app → Bands and indices: offers band tools (evidence: `spaces/app.py`)
- Hosted Gradio app → Print and web maps: offers map export (evidence: `spaces/app.py`)
