Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ dist-ssr
*.njsproj
*.sln
*.sw?

# Local PT accessibility merge input (generated locally, do not commit)
preprocessing/public-transport-accessibility/cities_with_pt_access.csv
33 changes: 32 additions & 1 deletion preprocess.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,8 @@
"source": [
"cities = pd.read_json('public/cities.json', orient='records')\n",
"\n",
"\n",
"\n",
"cities_europe_candidates = [Path('public/cities_europe.json'), Path('cities_europe.json')]\n",
"cities_europe_path = next((path for path in cities_europe_candidates if path.exists()), None)\n",
"if cities_europe_path is not None:\n",
Expand Down Expand Up @@ -458,6 +460,34 @@
" cities = pd.merge(cities, cities_europe[eu_merge_cols], on='id', how='left')\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "pt-access-merge",
"metadata": {},
"outputs": [],
"source": [
"pt_access = pd.read_csv(\n",
" Path('preprocessing/public-transport-accessibility/cities_with_pt_access.csv'),\n",
" usecols=['id', 'SDG1121pct'],\n",
")\n",
"pt_access = pt_access.rename(columns={'SDG1121pct': 'public_transport_accessibility'})\n",
"pt_access['id'] = pd.to_numeric(pt_access['id'], errors='coerce')\n",
"pt_access['public_transport_accessibility'] = pd.to_numeric(\n",
" pt_access['public_transport_accessibility'], errors='coerce'\n",
")\n",
"pt_access = pt_access.dropna(subset=['id'])\n",
"pt_access['id'] = pt_access['id'].astype(int)\n",
"pt_access = pt_access[['id', 'public_transport_accessibility']]\n",
"\n",
"cities['id'] = pd.to_numeric(cities['id'], errors='coerce')\n",
"cities = cities.dropna(subset=['id'])\n",
"cities['id'] = cities['id'].astype(int)\n",
"\n",
"cities = cities.drop(columns=['public_transport_accessibility'], errors='ignore')\n",
"cities = pd.merge(cities, pt_access, on='id', how='left')\n"
]
},
{
"cell_type": "code",
"execution_count": 44,
Expand Down Expand Up @@ -589,6 +619,7 @@
" 'hdi',\n",
" 'female_gender_index',\n",
" 'emissions',\n",
" 'public_transport_accessibility',\n",
"]\n",
"\n",
"for col in metric_cols:\n",
Expand Down Expand Up @@ -707,4 +738,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}
16 changes: 16 additions & 0 deletions preprocessing/public-transport-accessibility/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Public transport accessibility one-off preprocessing

This folder archives the one-off preprocessing artifacts used to add SDG 11.2.1
(urban access to public transport) into the explorer dataset.

Included artifacts:
- `city-mapping-SDG-PT-2026-05-19.ipynb`: matching workflow notebook.

The matched CSV (`cities_with_pt_access.csv`) is intentionally **not** stored in
the repository because its integrated values are already persisted in
`public/cities.json`.

Primary source citation:
- Center For International Earth Science Information Network (CIESIN), Columbia University (2023).
*SDG Indicator 11.2.1: Urban Access to Public Transport, 2023 Release*.
https://doi.org/10.7927/1A5Z-3H71

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/cities.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/components/InfoPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ const InfoPanel = ({ selectedSample, samples, setSelectedSample, setSearchValue
<p>
Metrics are sourced from the <a href="https://human-settlement.emergency.copernicus.eu/ghs_ucdb_2024.php" target="_blank" rel="noopener noreferrer"> Global Human Settlement Layer (GHSL)</a> and related datasets.
</p>
<p>
Public transport accessibility is based on SDG indicator 11.2.1 from <a href="https://doi.org/10.7927/1A5Z-3H71" target="_blank" rel="noopener noreferrer">CIESIN (2023)</a>.
</p>
<p>
Percentile ranks indicate the share of cities worldwide that have lower values, showing how each city compares to its global peers for each characteristic.
</p>
Expand Down
1 change: 1 addition & 0 deletions src/utils/metrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const metricList = [
{ key: "hdd", label: "Heating Degree Days", unit: "°C", decimals: -1 },
{ key: "cdd", label: "Cooling Degree Days", unit: "°C", decimals: -1 },
{ key: "critical_infrastructure", label: "Critical infrastructure index", decimals: 2 },
{ key: "public_transport_accessibility", label: "Public transport accessibility (SDG 11.2.1)", unit: "%", decimals: 1 },
{ key: "female_gender_index", label: "Female gender index", decimals: 2 },
{ key: "hdi", label: "Human development index", decimals: 2 },
{ key: "emissions", label: "GHG emissions", unit: "tCO₂e/cap", decimals: 2 },
Expand Down
Loading