# spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity architecture

> Architecture diagram of the GitHub repository spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity
- Repository: https://github.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity

## Overview

This repository provides notebooks for estimating urban green-space accessibility with a modified two-step floating catchment area (M2SFCA) model. A user supplies city data to the single-city workflow, or runs the set-of-cities workflow, which can fetch boundaries, green spaces, and road networks from OpenStreetMap. Both workflows prepare green-space and population data, construct origin–destination distances, and calculate accessibility scores; the documented method also normalizes scores for comparison. Only README relationships are available here, so links describe documented steps rather than inspected notebook calls.

Main entry points: [`code_for_a_set_of_cities.ipynb`](https://github.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity/blob/main/code_for_a_set_of_cities.ipynb) (Multi-city run), [`code_for_a_single_city.ipynb`](https://github.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity/blob/main/code_for_a_single_city.ipynb) (Nearby pairs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflows["City workflows"]
  node_single["Single-city run"]
  node_batch["Multi-city run"]
end

subgraph group_preparation["Data preparation"]
  node_greenprep["Green-space prep"]
  node_popprep["Population prep"]
  node_entrances["UGS entrances"]
  node_batchgreen["Green-space prep"]
  node_batchpop["Population prep"]
end

subgraph group_network["Distance analysis"]
  node_nearby["Nearby pairs"]
  node_origin["Origin nodes"]
  node_target["Target nodes"]
  node_od["OD distances"]
  node_nearest["Nearest entrances"]
  node_batchod["OD distances"]
end

subgraph group_scoring["Accessibility scoring"]
  node_m2sfca["M2SFCA score"]
  node_normalized["Normalized scores"]
  node_batchscore["M2SFCA score"]
end

node_user(("Analyst"))
node_osm[("OSM data")]

node_user -->|"supplies data"| node_single
node_user -->|"runs workflow"| node_batch
node_osm -.->|"provides city data"| node_batch
node_single -->|"preprocesses green"| node_greenprep
node_single -->|"preprocesses population"| node_popprep
node_greenprep -->|"creates access points"| node_entrances
node_popprep -->|"supplies population cells"| node_nearby
node_entrances -->|"supplies access points"| node_nearby
node_nearby -->|"feeds node lookup"| node_origin
node_nearby -->|"feeds node lookup"| node_target
node_origin -->|"feeds OD matrix"| node_od
node_target -->|"feeds OD matrix"| node_od
node_od -->|"filters distances"| node_nearest
node_nearest -->|"feeds model"| node_m2sfca
node_m2sfca -->|"normalizes scores"| node_normalized
node_batch -->|"preprocesses green"| node_batchgreen
node_batch -->|"preprocesses population"| node_batchpop
node_batchgreen -->|"supplies green data"| node_batchod
node_batchpop -->|"supplies population"| node_batchod
node_batchod -->|"feeds model"| node_batchscore

click node_single "https://github.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity/blob/main/code_for_a_single_city.ipynb"
click node_batch "https://github.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity/blob/main/code_for_a_set_of_cities.ipynb"
click node_greenprep "https://github.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity/blob/main/code_for_a_single_city.ipynb"
click node_popprep "https://github.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity/blob/main/code_for_a_single_city.ipynb"
click node_entrances "https://github.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity/blob/main/code_for_a_single_city.ipynb"
click node_nearby "https://github.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity/blob/main/code_for_a_single_city.ipynb"
click node_origin "https://github.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity/blob/main/code_for_a_single_city.ipynb"
click node_target "https://github.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity/blob/main/code_for_a_single_city.ipynb"
click node_od "https://github.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity/blob/main/code_for_a_single_city.ipynb"
click node_nearest "https://github.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity/blob/main/code_for_a_single_city.ipynb"
click node_m2sfca "https://github.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity/blob/main/code_for_a_single_city.ipynb"
click node_normalized "https://github.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity/blob/main/code_for_a_single_city.ipynb"
click node_batchgreen "https://github.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity/blob/main/code_for_a_set_of_cities.ipynb"
click node_batchpop "https://github.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity/blob/main/code_for_a_set_of_cities.ipynb"
click node_batchod "https://github.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity/blob/main/code_for_a_set_of_cities.ipynb"
click node_batchscore "https://github.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity/blob/main/code_for_a_set_of_cities.ipynb"

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_single,node_batch toneBlue
class node_greenprep,node_popprep,node_entrances,node_batchgreen,node_batchpop,node_osm toneAmber
class node_nearby,node_origin,node_target,node_od,node_nearest,node_batchod toneMint
class node_m2sfca,node_normalized,node_batchscore toneRose
class node_user toneIndigo
```

## Components

### City workflows

- [Single-city run](https://github.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity/blob/main/code_for_a_single_city.ipynb): `code_for_a_single_city.ipynb`
- [Multi-city run](https://github.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity/blob/main/code_for_a_set_of_cities.ipynb): `code_for_a_set_of_cities.ipynb`

### Data preparation

- [Green-space prep](https://github.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity/blob/main/code_for_a_single_city.ipynb): `code_for_a_single_city.ipynb`
- [Population prep](https://github.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity/blob/main/code_for_a_single_city.ipynb): `code_for_a_single_city.ipynb`
- [UGS entrances](https://github.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity/blob/main/code_for_a_single_city.ipynb): `code_for_a_single_city.ipynb`
- [Green-space prep](https://github.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity/blob/main/code_for_a_set_of_cities.ipynb): `code_for_a_set_of_cities.ipynb`
- [Population prep](https://github.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity/blob/main/code_for_a_set_of_cities.ipynb): `code_for_a_set_of_cities.ipynb`

### Distance analysis

- [Nearby pairs](https://github.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity/blob/main/code_for_a_single_city.ipynb): `code_for_a_single_city.ipynb`
- [Origin nodes](https://github.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity/blob/main/code_for_a_single_city.ipynb): `code_for_a_single_city.ipynb`
- [Target nodes](https://github.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity/blob/main/code_for_a_single_city.ipynb): `code_for_a_single_city.ipynb`
- [OD distances](https://github.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity/blob/main/code_for_a_single_city.ipynb): `code_for_a_single_city.ipynb`
- [Nearest entrances](https://github.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity/blob/main/code_for_a_single_city.ipynb): `code_for_a_single_city.ipynb`
- [OD distances](https://github.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity/blob/main/code_for_a_set_of_cities.ipynb): `code_for_a_set_of_cities.ipynb`

### Accessibility scoring

- [M2SFCA score](https://github.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity/blob/main/code_for_a_single_city.ipynb): `code_for_a_single_city.ipynb`
- [Normalized scores](https://github.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity/blob/main/code_for_a_single_city.ipynb): `code_for_a_single_city.ipynb`
- [M2SFCA score](https://github.com/spatial-data-science-and-geo-ai-lab/green-space-accessibility-democity/blob/main/code_for_a_set_of_cities.ipynb): `code_for_a_set_of_cities.ipynb`

### Other components

- **Analyst**
- **OSM data**

## Connections

- Analyst → Single-city run: supplies data (evidence: `README.md`)
- Analyst → Multi-city run: runs workflow (evidence: `README.md`)
- OSM data → Multi-city run: provides city data (evidence: `README.md`)
- Single-city run → Green-space prep: preprocesses green (evidence: `README.md`)
- Single-city run → Population prep: preprocesses population (evidence: `README.md`)
- Green-space prep → UGS entrances: creates access points (evidence: `README.md`)
- Population prep → Nearby pairs: supplies population cells (evidence: `README.md`)
- UGS entrances → Nearby pairs: supplies access points (evidence: `README.md`)
- Nearby pairs → Origin nodes: feeds node lookup (evidence: `README.md`)
- Nearby pairs → Target nodes: feeds node lookup (evidence: `README.md`)
- Origin nodes → OD distances: feeds OD matrix (evidence: `README.md`)
- Target nodes → OD distances: feeds OD matrix (evidence: `README.md`)
- OD distances → Nearest entrances: filters distances (evidence: `README.md`)
- Nearest entrances → M2SFCA score: feeds model (evidence: `README.md`)
- M2SFCA score → Normalized scores: normalizes scores (evidence: `README.md`)
- Multi-city run → Green-space prep: preprocesses green (evidence: `README.md`)
- Multi-city run → Population prep: preprocesses population (evidence: `README.md`)
- Green-space prep → OD distances: supplies green data (evidence: `README.md`)
- Population prep → OD distances: supplies population (evidence: `README.md`)
- OD distances → M2SFCA score: feeds model (evidence: `README.md`)
