Urban data science with Python

Cities are the most interconnected systems most of us will ever work with: streets link to streets, amenities cluster along them, and every home sits some number of minutes from a school, a shop, a station. All of that has a location, and almost all of it is openly available. That is what makes urban analytics such a natural home for spatial data science — the available data is improving fast, the questions are concrete, and the answers show up on a map.

The Urban Data Science journey teaches you to work with exactly that. You acquire a city's data from OpenStreetMap and turn it into a reusable urban profile, then build models on top of it — accessibility, site selection, livability, and price — at the resolution of individual buildings, and finish with a course on the network analytics that run underneath all of it. To get started with these six steps, this journey assumes the Getting Started journey or the equivalent: comfortable Python, a first contact with GeoPandas, and familiarity with core GIS concepts.

One scope note up front: this journey works almost entirely with vector data — points, lines, polygons, graphs. Satellite imagery appears exactly once, as an NDVI layer in the greenery score. If you want the raster side in depth, the Satellite Data Science course in the GeoAI journey is the place; here it stays a supporting actor.

Reading a city (steps 1–3)

The route opens with an eight-minute video: nearly 100,000 Budapest street segments coloured by accident statistics, interactive in Folium. It is there to show, once and fast, what the first course teaches at depth — a city is a set of layers you can acquire, join, and question.

The first complete course, Urban Analytics with Python: An Introduction then does it properly, on Vienna. You pull administrative boundaries, points of interest, building footprints, and road networks from OpenStreetMap yourself, and you learn to handle what actually arrives: place names that will not resolve, tags that are only half filled in, geometries contaminated by neighbours. Buildings get mapped by function and then by continuous attributes — area, height, floors. Roads become graphs, and graphs yield hubs and statistics. Every layer turns into one reusable urban profile, and the final chapter scales that profile across all 23 districts into an adjustable 1–10 livability score. Adjustable is stressed here: a livability index is subjective, every weight is a choice, and the value of building one line by line is knowing exactly which choices you made.

Step three, the How Walkable Is Your City?, takes the Introduction's closing question to a different scale. The livability score was by district; walkability is by street, across four capitals, measured along the network rather than as the crow flies. That shift — from an area to a point on a graph — is what the next course assumes you have already felt.

Modelling a city (steps 4–5)

The second course of this journey, Urban Analytics with Python: Advanced Methods works on the whole island of Manhattan, roughly 50,000 building footprints, and layers five real use cases on top of one study area. Site selection combines two clustering methods — DBSCAN to find organic agglomerations of amenities, KMeans to assign functional types to a grid — because each answers a different half of "where should this open." Accessibility is computed across the real road network with Pandana, with subway data parsed from GTFS, so that fifteen minutes means fifteen minutes of walking rather than a circle on a map. A greenery score fuses official park polygons with Sentinel-2 NDVI at ten-metre resolution — formal green space plus the ambient green a park boundary cannot see. A persona-based livability index puts a specific person — car-free, professional — at the centre of the weights. And a price model compares ordinary regression with a spatial-lag regression, so you can see where spatial dependence helps and where it does not.

Everything is computed at building resolution and carried forward, so by the end each of those 50,000 buildings carries accessibility, greenery, livability, and price features you built yourself.

Step five, Mapping NYC Subway Accessibility, extends the accessibility chapter to every station in the system — an isochrone per station, animated five seconds of walking at a time. It is also the moment the street network stops being the thing you measure along and becomes the thing you look at.

Cities are networks (step 6)

In Connecting the Dots I describe road networks as the structural layer of a city — intersections as nodes, street segments as edges, a layer that hardly changes once built and that tells you a lot about a city's past and offers clues about its future. It is also the scientific basis for testing ideas like amenity accessibility and the 15-minute city, rather than just talking about them. Everything in this journey lives on that layer: the Introduction turns roads into graphs, the Advanced course measures walking time across them, and the transit tutorials add schedules on top. (The book goes on to two further tiers — the movement of people and the social fabric — but those need mobility and social data, and this journey deliberately stays with what OpenStreetMap and open city portals provide.)

Network Analytics & Visualization in Python closes the journey by teaching the machinery underneath all three tiers. From your first graph object in NetworkX to centralities, communities, and degree distributions; from synthetic benchmarks — Erdős–Rényi, Watts–Strogatz, Barabási–Albert — to the comparison against random references that tells real structure from noise; and a bridge into Gephi for the visual side. It comes last because by now every concept already has a city attached. Learned first, it would be abstract.

What you can do afterwards

Point the pipeline at a city you know. Every framework in the journey is written to be re-run — swap the amenity, the persona, the city. The going-deeper shelf continues along the same threads: transit accessibility from raw GTFS, three sources of building footprints compared, forty years of urban heat from the Landsat archive, and a shadow map of every building in Budapest. Together with the Getting Started journey this is the complete vector side of the platform; the GeoAI journey is where the pixels take over.

Extra steps

The going-deeper shelf continues the same threads with more cities and more data sources. On transit, Budapest Transit Accessibility from GTFS takes the accessibility method to a 100,000-node walking graph, one map per mode. On buildings, OpenStreetMap vs Global Building Atlas and Overture vs OSM complete the comparison — three global footprint sources, so you know what each one is missing before you rely on it. On the environmental side, 40 Years of Budapest's Heat From Space and its follow-up Who Actually Lives in Budapest's Heat bring the Landsat archive into the urban toolkit, and The Shadow Map computes every building's shadow in the city in under a second on a laptop. Two tutorials revisit methods from the courses on new questions: Topical Hot Spots applies the DBSCAN site-selection method to lifestyle amenities, and Urban Green Equality tests green space per capita against income across Vienna's districts. Finally, 20 Urban Analytics Concepts is the vocabulary of both courses in one place, and two reading lists — 20 Urban Heat & Heatwave Papers and Geospatial Data Science for Urban Planning — point to the research behind all of it.

Previous
Previous

GeoAI - From a raster you draw by hand to a model you trained

Next
Next

How to get started in geospatial data science