Categories
Academia

New Article: OSMnx in CEUS

My article “OSMnx: New methods for acquiring, constructing, analyzing, and visualizing complex street networks” was published in the journalĀ Computers, Environment and Urban Systems earlier this month. OSMnx is a Python package that lets you download a street network anywhere in the world at any scale with a single line of code, then analyze or visualize it with one more line of code.

OSMnx: Figure-ground diagrams of one square mile of each street network, from OpenStreetMap, made in Python with matplotlib, geopandas, and NetworkX

Categories
Planning

Isochrone Maps with OSMnx + Python

Check out the journal article about OSMnx.

How far can you travel on foot in 15 minutes? Urban planners use isochrone maps to show spatial horizons (i.e., isolines) that are equal in time. Isochrones depict areas according to how long it takes to arrive there from some point. These visualizations are particularly useful in transportation planning as they reveal what places are accessible within a set of time horizons.

We can create isochrone maps for anywhere in the world automatically with Python and its OSMnx package:

OSMnx map of isochrone isolines in Berkeley California's street network

Categories
Data

OSMnx and Street Network Elevation Data

Check out the journal article about OSMnx.

OSMnx can now download street network elevation data for anywhere in the world. In one line of code it downloads the elevation in meters of each network node, and in one more line of code it can calculate every street (i.e., edge) grade. Here is the complete street network of San Francisco, California, with nodes colored according to their elevation:

OSMnx street network elevation data for San Francisco, California to calculate street grade and steepness

Categories
Planning

Urban Form Analysis with OpenStreetMap Data

Figure-ground diagrams of urban form and building footprints in London, Paris, Venice, and Brasilia depict modernism's inversion of traditional spatial orderCheck out the journal article about OSMnx. This is a summary of some of my recent research on making OpenStreetMap data analysis easy for urban planners. It was alsoĀ published on the ACSP blog.

OpenStreetMapĀ ā€“ a collaborative worldwide mapping project inspired by Wikipedia ā€“ has emerged in recent years as a major player both for mapping and acquiring urban spatial data. Though coverage varies somewhat worldwide, its data are of high quality and compare favorably to CIA World Factbook estimates and US Census TIGER/Line data. OpenStreetMap imported the TIGER/Line roads in 2007 and since then its community has made numerous corrections and improvements. In fact, many of these additions go beyond TIGER/Line’s scope, including for example passageways between buildings, footpaths through parks, bike routes, and detailed feature attributes such as finer-grained street classifiers, speed limits, etc.

This presents a fantastic data source to help answer urban planning questions, but OpenStreetMap’s data has been somewhat difficult to work with due to its Byzantine query language and coarse-grained bulk extracts provided by third parties. As part of my dissertation, I developed a tool called OSMnx that allows researchers to download street networks and building footprints for any city name, address, or polygon in the world, then analyze and visualize them. OSMnx democratizes these data and methods to help technical and non-technical planners and researchers use OpenStreetMap data to study urban form, circulation networks, accessibility, and resilience.

Categories
Planning

Urban Form Figure-Ground Diagrams

Check out the journal article about OSMnx.

I previously demonstrated how to create figure-groundĀ square-mile visualizations of urban street networks with OSMnx to consistently compare city patterns, design paradigms, and connectivity. OSMnx downloads, analyzes, and visualizes street networks from OpenStreetMap but it can also getĀ building footprints. If we mash-up these building footprints with the street networks, we get a fascinating comparative window into urban form:

Figure-ground map of building footprints and street network in New York, San Francisco, Monrovia, and Port au Prince from OpenStreetMap data, created in Python with OSMnx

Categories
Tech

Getting Started with Python

Piedmont, California street network created in Python with OSMnx, networkx, matplotlibThis is a guide for absolute beginners to get started using Python. Since releasing OSMnx a few weeks ago, I’ve received a lot of comments from people who would love to try it out, but don’t know where to begin withĀ Python. I’ll demonstrate how to get Python up and running on your system, how to install packages, and how to run code.

Categories
Planning

Square-Mile Street Network Visualization

Check out the journal article about OSMnx. All figures in this article come from this journal article, which you can read/cite for more.

The heart of Allan Jacobs’ classic book on street-level urban form and design, Great Streets, features dozens of hand-drawn figure-ground diagrams in the style of Nolli maps. Each depicts one square mile of a city’s street network. Drawing these cities at the same scale provides a revealing spatial objectivity in visually comparing their street networks and urban forms.

We can recreate these visualizations automatically with Python and the OSMnx package, which I developed as part of my dissertation. With OSMnx we can download a street network from OpenStreetMap for anywhere in the world in just one line of code. Here are the square-mile diagrams of Portland, San Francisco, Irvine, and Rome created and plotted automatically by OSMnx:

OSMnx: Figure-ground diagrams of one square mile of Portland, San Francisco, Irvine, and Rome shows the street network, urban form, and urban design in these cities

Categories
Planning

OSMnx: Python for Street Networks

OSMnx: New York City urban street network visualized and analyzed with Python and OpenStreetMap dataIf you use OSMnx in your work, please cite the journal article.

OSMnx is a Python package to retrieve, model, analyze, and visualize street networks from OpenStreetMap. Users can download and model walkable, drivable, or bikeable urban networks with a single line of Python code, and then easily analyze and visualize them. You can just as easily download and work with amenities/points of interest, building footprints, elevation data, street bearings/orientations, and network routing. If you use OSMnx in your work, please download/cite the paper here.

In a single line of code, OSMnx lets you download, model, and visualize the street network for, say, Modena Italy:

import osmnx as ox
ox.plot_graph(ox.graph_from_place('Modena, Italy'))

OSMnx: Modena Italy networkx street network in Python from OpenStreetMap

Categories
Data

R-tree Spatial Indexing with Python

r-tree spatial index with python geopandas: Thumbnail of Walnut Creek, California city boundary and street intersections inside and outside city limits Check out the journal article about OSMnx, which implements this technique.

A spatial index such as R-tree can drastically speed up GIS operations like intersections and joins. Spatial indices are key features of spatial databases like PostGIS, but they’re also available for DIY coding in Python. I’ll introduce how R-trees work and how to use them in Python and its geopandas library. All of my code is in this notebook in this urban data science GitHub repo.

Categories
Planning

Craigslist and U.S. Rental Housing Markets

This is a summary of our JPER journal article (available here) about Craigslist rental listings’ insights into U.S. housing markets.

Small map of 1.5 million Craigslist rental listings in the contiguous U.S., divided into quintiles by each listing's rent per square footRentals make up a significant portion of the U.S. housing market, but much of this market activity is poorly understood due to its informal characteristics and historically minimal data trail. The UC Berkeley Urban Analytics Lab collected, validated, and analyzed 11 million Craigslist rental listings to discover fine-grained patterns across metropolitan housing markets in the United States. I’ll summarize our findings below and explain the methodology at the bottom.

But first, 4 key takeaways:

  1. There are incredibly few rental units below fair market rent in the hottest housing markets. Some metro areas like New York and Boston have only single-digit percentages of Craigslist rental listings below fair market rent. That’s really low.
  2. This problem doesn’t exclusively affect the poor: the share of its income that the typical household would spend on the typical rent in cities like New York and San Francisco exceeds the threshold for “rent burden.”
  3. Rents are more “compressed” in soft markets. For example, in Detroit, most of the listed units are concentrated within a very narrow band of rent/ftĀ² values, but in San Francisco rents are much more dispersed. Housing vouchers may end up working very differently in high-cost vs low-cost areas.
  4. Craigslist listings correspond reasonably well with Dept of Housing and Urban Development (HUD) estimates, but provide up-to-date data including unit characteristics, from neighborhood to national scales. For example, we can see how rents are changing, neighborhood by neighborhood, in San Francisco in a given month.