# ovirahman/bangladesh architecture

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

- Interactive diagram: https://gitdiagram.com/ovirahman/bangladesh
- Repository: https://github.com/ovirahman/bangladesh

## Overview

The package supplies Bangladesh administrative-boundary sf objects and utilities for retrieving, filtering, searching, and finding region centers, with plotting as a user-facing result. The README documents the user-visible relationships; no source excerpts were available, so internal calls beyond those documented are omitted.

Main entry points: [`R/get_map.R`](https://github.com/ovirahman/bangladesh/blob/master/R/get_map.R) (Get map), [`R/bd_search.R`](https://github.com/ovirahman/bangladesh/blob/master/R/bd_search.R) (Search areas), [`R/bd_plot.R`](https://github.com/ovirahman/bangladesh/blob/master/R/bd_plot.R) (Plot maps), [`R/get_coordinates.R`](https://github.com/ovirahman/bangladesh/blob/master/R/get_coordinates.R) (Get coordinates)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["User functions"]
  node_get_map["Get map<br/>[get_map.R]"]
  node_get_divisions["Filter divisions<br/>[get_divisions.R]"]
  node_bd_search["Search areas<br/>[bd_search.R]"]
  node_get_coordinates["Get coordinates<br/>[get_coordinates.R]"]
  node_area_names_fn["Area-name access<br/>[get_area_name.R]"]
end

subgraph group_boundaries["Boundary data"]
  node_map_assets[("Administrative boundaries<br/>[map_country.rda]")]
  node_map_division[("Division boundaries<br/>[map_division.rda]")]
  node_map_district[("District boundaries<br/>[map_district.rda]")]
  node_map_upazila[("Upazila boundaries<br/>[map_upazila.rda]")]
  node_map_union[("Union boundaries<br/>[map_union.rda]")]
end

subgraph group_regional["Regional data"]
  node_area_names[("Area names<br/>[area_names.rda]")]
  node_pop_division[("Division population")]
  node_pop_district[("District population")]
  node_pop_upazila[("Upazila population")]
end

subgraph group_visualization["Mapping"]
  node_bd_plot["Plot maps<br/>[bd_plot.R]"]
end

node_user(("R user"))
node_tmap["tmap"]

node_user -->|"requests maps"| node_get_map
node_get_map -->|"returns boundaries"| node_map_assets
node_user -->|"requests subset"| node_get_divisions
node_user -->|"searches areas"| node_bd_search
node_user -->|"requests centers"| node_get_coordinates
node_user -->|"plots regions"| node_bd_plot
node_bd_plot -->|"uses plotting"| node_tmap
node_bd_search -->|"includes centers"| node_get_coordinates

click node_get_map "https://github.com/ovirahman/bangladesh/blob/master/R/get_map.R"
click node_get_divisions "https://github.com/ovirahman/bangladesh/blob/master/R/get_divisions.R"
click node_bd_search "https://github.com/ovirahman/bangladesh/blob/master/R/bd_search.R"
click node_get_coordinates "https://github.com/ovirahman/bangladesh/blob/master/R/get_coordinates.R"
click node_area_names_fn "https://github.com/ovirahman/bangladesh/blob/master/R/get_area_name.R"
click node_map_assets "https://github.com/ovirahman/bangladesh/blob/master/data/map_country.rda"
click node_map_division "https://github.com/ovirahman/bangladesh/blob/master/data/map_division.rda"
click node_map_district "https://github.com/ovirahman/bangladesh/blob/master/data/map_district.rda"
click node_map_upazila "https://github.com/ovirahman/bangladesh/blob/master/data/map_upazila.rda"
click node_map_union "https://github.com/ovirahman/bangladesh/blob/master/data/map_union.rda"
click node_area_names "https://github.com/ovirahman/bangladesh/blob/master/data/area_names.rda"
click node_pop_division "https://github.com/ovirahman/bangladesh/blob/master/data/pop_division_2011.rda"
click node_pop_district "https://github.com/ovirahman/bangladesh/blob/master/data/pop_district_2011.rda"
click node_pop_upazila "https://github.com/ovirahman/bangladesh/blob/master/data/pop_upazila_2011.rda"
click node_bd_plot "https://github.com/ovirahman/bangladesh/blob/master/R/bd_plot.R"

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_get_map,node_get_divisions,node_bd_search,node_get_coordinates,node_area_names_fn,node_user toneBlue
class node_map_assets,node_map_division,node_map_district,node_map_upazila,node_map_union toneAmber
class node_area_names,node_pop_division,node_pop_district,node_pop_upazila toneMint
class node_bd_plot toneRose
class node_tmap toneIndigo
```

## Components

### User functions

- [Get map](https://github.com/ovirahman/bangladesh/blob/master/R/get_map.R): `R/get_map.R`
- [Filter divisions](https://github.com/ovirahman/bangladesh/blob/master/R/get_divisions.R): `R/get_divisions.R`
- [Search areas](https://github.com/ovirahman/bangladesh/blob/master/R/bd_search.R): `R/bd_search.R`
- [Get coordinates](https://github.com/ovirahman/bangladesh/blob/master/R/get_coordinates.R): `R/get_coordinates.R`
- [Area-name access](https://github.com/ovirahman/bangladesh/blob/master/R/get_area_name.R): `R/get_area_name.R`

### Boundary data

- [Administrative boundaries](https://github.com/ovirahman/bangladesh/blob/master/data/map_country.rda): `data/map_country.rda`
- [Division boundaries](https://github.com/ovirahman/bangladesh/blob/master/data/map_division.rda): `data/map_division.rda`
- [District boundaries](https://github.com/ovirahman/bangladesh/blob/master/data/map_district.rda): `data/map_district.rda`
- [Upazila boundaries](https://github.com/ovirahman/bangladesh/blob/master/data/map_upazila.rda): `data/map_upazila.rda`
- [Union boundaries](https://github.com/ovirahman/bangladesh/blob/master/data/map_union.rda): `data/map_union.rda`

### Regional data

- [Area names](https://github.com/ovirahman/bangladesh/blob/master/data/area_names.rda): `data/area_names.rda`
- [Division population](https://github.com/ovirahman/bangladesh/blob/master/data/pop_division_2011.rda): `data/pop_division_2011.rda`
- [District population](https://github.com/ovirahman/bangladesh/blob/master/data/pop_district_2011.rda): `data/pop_district_2011.rda`
- [Upazila population](https://github.com/ovirahman/bangladesh/blob/master/data/pop_upazila_2011.rda): `data/pop_upazila_2011.rda`

### Mapping

- [Plot maps](https://github.com/ovirahman/bangladesh/blob/master/R/bd_plot.R): `R/bd_plot.R`

### Other components

- **R user**
- **tmap**

## Connections

- R user → Get map: requests maps (evidence: `README.md`)
- Get map → Administrative boundaries: returns boundaries (evidence: `README.md`)
- R user → Filter divisions: requests subset (evidence: `README.md`)
- R user → Search areas: searches areas (evidence: `README.md`)
- R user → Get coordinates: requests centers (evidence: `README.md`)
- R user → Plot maps: plots regions (evidence: `README.md`)
- Plot maps → tmap: uses plotting (evidence: `README.md`)
- Search areas → Get coordinates: includes centers (evidence: `README.md`)
