# yash12birth/cadastre_3d_pot architecture

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

- Interactive diagram: https://gitdiagram.com/yash12birth/cadastre_3d_pot
- Repository: https://github.com/yash12birth/cadastre_3d_pot

## Overview

#### Purpose and entry points
This is a geospatial imagery analysis pipeline centered on an orthomosaic and digital surface model (DSM), likely for detecting objects and estimating their heights. Primary executable entry points are:
- `download_day1.py` — acquires the Day 1 image input.
- `verify_day1.py` — validates downloaded/input imagery.
- `create_dummy_data.py` — creates local sample geospatial data.
- `src/ai_extraction.py` and `src/height_estimation.py` — core analysis stages.

#### Input acquisition and validation
The pipeline accepts image data under `day1_input/images` and raster products under `data/`.
- `download_day1.py`
- `verify_day1.py`
- `day1_input/images`

Acquisition and verification are an upstream boundary: downstream analysis should operate on validated imagery/raster files rather than external download results.

#### Geospatial data layer
Two checked-in raster artifacts form the principal analysis inputs:
- `data/orthomosaic.tif`
- `data/dsm.tif`

The orthomosaic supplies spatially aligned visual imagery for AI extraction. The DSM supplies elevation values used to derive height measurements. Their coordinate alignment, raster dimensions, and georeferencing are critical implicit contracts between stages.

#### AI extraction stage
Object/feature detection is implemented in:
- `src/ai_extraction.py`
- `src/__init__.py`

This stage consumes imagery, most plausibly the orthomosaic or Day 1 images, and produces detected regions, masks, coordinates, or feature records for later measurement. It is the boundary between image-understanding logic and geospatial quantification.

#### Height estimation stage
Height calculation is isolated in:
- `src/height_estimation.py`
- `data/dsm.tif`
- `data/orthomosaic.tif`

This component should join AI-extracted feature locations with DSM elevation samples. Its output is expected to enrich detections with height-related metrics; it depends on consistent pixel/world-coordinate mapping across source rasters.

#### Configuration and presentation surface
Shared runtime settings are centralized in:
- `config.py`

A standalone HTML artifact may be intended for displaying outputs or results, but no application structure is visible from the tree:
- `index.html`

No server, deployment manifest, database, or cloud infrastructure is present. The repository appears designed for local Python execution over filesystem-based GeoTIFF inputs and outputs.

Main entry points: [`src/height_estimation.py`](https://github.com/yash12birth/cadastre_3d_pot/blob/main/src/height_estimation.py) (Height estimation), [`src/ai_extraction.py`](https://github.com/yash12birth/cadastre_3d_pot/blob/main/src/ai_extraction.py) (AI extraction), [`create_dummy_data.py`](https://github.com/yash12birth/cadastre_3d_pot/blob/main/create_dummy_data.py) (Sample data creator), [`data/orthomosaic.tif`](https://github.com/yash12birth/cadastre_3d_pot/blob/main/data/orthomosaic.tif) (Orthomosaic)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Input preparation"]
  node_download["Day 1 download<br/>Python entry point<br/>[download_day1.py]"]
  node_verify["Imagery verification<br/>Python entry point<br/>[verify_day1.py]"]
  node_dummy_data["Sample data creator<br/>Python utility"]
  node_day1_images["Day 1 images<br/>image directory"]
end

subgraph group_analysis["Geospatial analysis"]
  node_orthomosaic[("Orthomosaic<br/>GeoTIFF raster<br/>[orthomosaic.tif]")]
  node_dsm[("Digital surface model<br/>GeoTIFF raster<br/>[dsm.tif]")]
  node_config["Runtime settings<br/>Python configuration<br/>[config.py]"]
  node_ai_extraction["AI extraction<br/>Python analysis stage<br/>[ai_extraction.py]"]
  node_src_package["Analysis package<br/>Python package<br/>[__init__.py]"]
  node_detections["Detected features<br/>feature records"]
  node_height_estimation["Height estimation<br/>Python analysis stage"]
end

subgraph group_presentation["Results surface"]
  node_measured_results["Height-enriched results<br/>analysis output"]
  node_index["Results page<br/>HTML artifact<br/>[index.html]"]
end

node_download -->|"acquires"| node_day1_images
node_dummy_data -.->|"can create"| node_day1_images
node_dummy_data -.->|"can create"| node_orthomosaic
node_dummy_data -.->|"can create"| node_dsm
node_day1_images -->|"validates"| node_verify
node_verify -->|"approved imagery"| node_ai_extraction
node_orthomosaic -->|"imagery input"| node_ai_extraction
node_config -.->|"settings"| node_ai_extraction
node_src_package -.->|"packages"| node_ai_extraction
node_ai_extraction -->|"produces"| node_detections
node_detections -->|"feature locations"| node_height_estimation
node_orthomosaic -->|"coordinate reference"| node_height_estimation
node_dsm -->|"elevation samples"| node_height_estimation
node_config -.->|"settings"| node_height_estimation
node_src_package -.->|"packages"| node_height_estimation
node_height_estimation -->|"produces"| node_measured_results
node_measured_results -.->|"may display"| node_index

click node_download "https://github.com/yash12birth/cadastre_3d_pot/blob/main/download_day1.py"
click node_verify "https://github.com/yash12birth/cadastre_3d_pot/blob/main/verify_day1.py"
click node_dummy_data "https://github.com/yash12birth/cadastre_3d_pot/blob/main/create_dummy_data.py"
click node_day1_images "https://github.com/yash12birth/cadastre_3d_pot/tree/main/day1_input/images"
click node_orthomosaic "https://github.com/yash12birth/cadastre_3d_pot/blob/main/data/orthomosaic.tif"
click node_dsm "https://github.com/yash12birth/cadastre_3d_pot/blob/main/data/dsm.tif"
click node_config "https://github.com/yash12birth/cadastre_3d_pot/blob/main/config.py"
click node_ai_extraction "https://github.com/yash12birth/cadastre_3d_pot/blob/main/src/ai_extraction.py"
click node_src_package "https://github.com/yash12birth/cadastre_3d_pot/blob/main/src/__init__.py"
click node_height_estimation "https://github.com/yash12birth/cadastre_3d_pot/blob/main/src/height_estimation.py"
click node_index "https://github.com/yash12birth/cadastre_3d_pot/blob/main/index.html"

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_download,node_verify,node_dummy_data,node_day1_images toneBlue
class node_orthomosaic,node_dsm,node_config,node_ai_extraction,node_src_package,node_detections,node_height_estimation toneAmber
class node_measured_results,node_index toneMint
```

## Components

### Input preparation

- [Day 1 download](https://github.com/yash12birth/cadastre_3d_pot/blob/main/download_day1.py): Python entry point · Acquires Day 1 imagery. · `download_day1.py`
- [Imagery verification](https://github.com/yash12birth/cadastre_3d_pot/blob/main/verify_day1.py): Python entry point · Validates imagery before analysis. · `verify_day1.py`
- [Sample data creator](https://github.com/yash12birth/cadastre_3d_pot/blob/main/create_dummy_data.py): Python utility · Creates local geospatial sample data. · `create_dummy_data.py`
- [Day 1 images](https://github.com/yash12birth/cadastre_3d_pot/tree/main/day1_input/images): image directory · `day1_input/images`

### Geospatial analysis

- [Orthomosaic](https://github.com/yash12birth/cadastre_3d_pot/blob/main/data/orthomosaic.tif): GeoTIFF raster · Spatially aligned visual imagery. · `data/orthomosaic.tif`
- [Digital surface model](https://github.com/yash12birth/cadastre_3d_pot/blob/main/data/dsm.tif): GeoTIFF raster · Elevation raster used for measurements. · `data/dsm.tif`
- [Runtime settings](https://github.com/yash12birth/cadastre_3d_pot/blob/main/config.py): Python configuration · `config.py`
- [AI extraction](https://github.com/yash12birth/cadastre_3d_pot/blob/main/src/ai_extraction.py): Python analysis stage · Converts imagery into detected features. · `src/ai_extraction.py`
- [Analysis package](https://github.com/yash12birth/cadastre_3d_pot/blob/main/src/__init__.py): Python package · `src/__init__.py`
- **Detected features**: feature records · Regions, masks, or coordinates for measurement.
- [Height estimation](https://github.com/yash12birth/cadastre_3d_pot/blob/main/src/height_estimation.py): Python analysis stage · Samples elevation and enriches detected features. · `src/height_estimation.py`

### Results surface

- **Height-enriched results**: analysis output
- [Results page](https://github.com/yash12birth/cadastre_3d_pot/blob/main/index.html): HTML artifact · Standalone display surface for outputs. · `index.html`

## Connections

- Day 1 download → Day 1 images: acquires
- Sample data creator → Day 1 images: can create
- Sample data creator → Orthomosaic: can create
- Sample data creator → Digital surface model: can create
- Day 1 images → Imagery verification: validates
- Imagery verification → AI extraction: approved imagery
- Orthomosaic → AI extraction: imagery input
- Runtime settings → AI extraction: settings
- Analysis package → AI extraction: packages
- AI extraction → Detected features: produces
- Detected features → Height estimation: feature locations
- Orthomosaic → Height estimation: coordinate reference · Provides aligned pixel/world mapping.
- Digital surface model → Height estimation: elevation samples
- Runtime settings → Height estimation: settings
- Analysis package → Height estimation: packages
- Height estimation → Height-enriched results: produces
- Height-enriched results → Results page: may display
