Skip to content

WP1.9: Add public transport accessibility indicator (SDG 11.2.1) - #7

Open
FlorianNachtigall wants to merge 1 commit into
mainfrom
floriannachtigall-add-public-transport-accessibility-indic
Open

FlorianNachtigall wants to merge 1 commit into
mainfrom
floriannachtigall-add-public-transport-accessibility-indic

Conversation

@FlorianNachtigall

@FlorianNachtigall FlorianNachtigall commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Summary

  • integrate SDG 11.2.1 public transport accessibility into the preprocessing flow
  • add public_transport_accessibility to exported city characteristics/percentiles and regenerate public/cities.json
  • wire the new metric into UI metadata so it appears in explorer controls and city characteristics
  • add one-off mapping notebook archive under preprocessing/public-transport-accessibility/
  • keep local merge input CSV untracked via .gitignore

Notes

  • this PR does not update README (left intentionally for follow-up)

Map visualization of indicator-city matching results and NaN-fill logic via geographically weighted regression

cities_pt_access_infill_map.html

image

Closes #6

Integrate SDG 11.2.1 PT accessibility into preprocessing and UI metrics, regenerate cities data, and archive one-off mapping notebook under preprocessing/public-transport-accessibility. Keep local merge CSV untracked via .gitignore.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

🚀 Preview deployed for this PR:

https://ai4up.github.io/cities-learning-explorer/pr-7/

This comment is kept up to date automatically.

@FlorianNachtigall
FlorianNachtigall force-pushed the floriannachtigall-add-public-transport-accessibility-indic branch from 816b03b to 73f3b5b Compare October 5, 2026 19:55

@SimonMontfort SimonMontfort left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one specific comment check; otherwise good to go from my point of view.

Comment on lines +796 to +798
"gdf_pt_access['region'] = gdf_pt_access['CTR_MN_NM'].replace(country_rename).map(cities_ipcc.drop_duplicates(subset='country').set_index('country')['region'])\n",
"gdf_pt_access['population_density'] = gdf_pt_access['Total_POP'] / gdf_pt_access.to_crs(cities_ipcc.crs).area.div(1e6)\n",
"gdf_pt_access_norm = normalize_popdens(gdf_pt_access.rename(columns={'CTR_MN_NM': 'country'}), popdens_col='population_density',\n",

@SimonMontfort SimonMontfort Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

country_rename isn't applied here, so 6 countries may get imputed values

This renames the column CTR_MN_NM to country. The values keep the SDG spelling ('Mexico', 'Czech Republic', 'Cape Verde', …), while result['country'] uses the other spelling ('México', 'Czechia', 'Cabo Verde', …).

In gwr_infill_missing, the loop iterates over donor countries and looks up receivers with out[country_col] == country. For 'Mexico' it finds no receivers and continues, and 'México' is never visited. So every missing city in México, Czechia, Cabo Verde, North Macedonia, Palestine and Republic of the Congo silently stays unfilled.

Suggested fix (ideally the country line would go right after loading the shapefile, so it can be reused everywhere):

Suggested change
"gdf_pt_access['region'] = gdf_pt_access['CTR_MN_NM'].replace(country_rename).map(cities_ipcc.drop_duplicates(subset='country').set_index('country')['region'])\n",
"gdf_pt_access['population_density'] = gdf_pt_access['Total_POP'] / gdf_pt_access.to_crs(cities_ipcc.crs).area.div(1e6)\n",
"gdf_pt_access_norm = normalize_popdens(gdf_pt_access.rename(columns={'CTR_MN_NM': 'country'}), popdens_col='population_density',\n",
"gdf_pt_access['country'] = gdf_pt_access['CTR_MN_NM'].replace(country_rename)\n",
"gdf_pt_access['region'] = gdf_pt_access['country'].map(cities_ipcc.drop_duplicates(subset='country').set_index('country')['region'])\n",
"gdf_pt_access['population_density'] = gdf_pt_access['Total_POP'] / gdf_pt_access.to_crs(cities_ipcc.crs).area.div(1e6)\n",
"gdf_pt_access_norm = normalize_popdens(gdf_pt_access, popdens_col='population_density',\n",

I have not run the entire code though and checked. So before accepting, it may be worthwhile to check this.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WP1.9: Add public transport accessibility indicator

2 participants