Categories
Data

OSMnx Features Round-Up

OSMnx is a Python package for quickly and easily downloading, modeling, analyzing, and visualizing street networks and other spatial data from OpenStreetMap. Here’s a quick round-up of recent updates to OSMnx. I’ll try to keep this up to date as a single reference source. A lot of new features have appeared in the past few months, and people have been asking about what’s new and what’s possible. You can:

  • Download and model street networks or other networked infrastructure anywhere in the world with a single line of code
  • Download any other spatial geometries, place boundaries, building footprints, or points of interest as a GeoDataFrame
  • Download by city name, polygon, bounding box, or point/address + network distance
  • Download drivable, walkable, bikeable, or all street networks
  • Download node elevations and calculate edge grades (inclines)
  • Impute missing speeds and calculate graph edge travel times
  • Simplify and correct the network’s topology to clean-up nodes and consolidate intersections
  • Fast map-matching of points, routes, or trajectories to nearest graph edges or nodes
  • Save networks to disk as shapefiles, geopackages, and GraphML
  • Save/load street network to/from a local .osm xml file
  • Conduct topological and spatial analyses to automatically calculate dozens of indicators
  • Calculate and visualize street bearings and orientations
  • Calculate and visualize shortest-path routes that minimize distance, travel time, elevation, etc
  • Visualize street networks as a static map or interactive leaflet web map
  • Visualize travel distance and travel time with isoline and isochrone maps
  • Plot figure-ground diagrams of street networks and building footprints
Categories
Data

Street Network Orientation

OSMnx is a Python package for easily downloading and analyzing street networks anywhere in the world. Among other analyses, we can use it to explore street network orientation. That is, what are the bearings and spatial orientations of the streets in the network? All of the code for this example is in this GitHub notebook. First we use OSMnx to download the street network of Moraga, California, a small town in the hills just east of Berkeley:

Moraga, California street network OSMnx OpenStreetMap Python

OSMnx automatically calculates all of the streets’ bearings. Specifically it calculates the compass bearing from each directed edge’s origin nodeĀ u to its destination nodeĀ v. Now we can visualize these bearings, binned together as a histogram to get a sense of the relative frequency of the streets’ spatial orientations. Or better yet, we can project that histogram as a polar plot to match the compass bearings:

Moraga, California street network orientation edge bearings polar plot OSMnx OpenStreetMap Python

Categories
Academia

New Article: Craigslist Housing Markets in JPER

Our article “New Insights into Rental Housing Markets across the United States: Web Scraping and Analyzing Craigslist Rental Listings” is finally appearing in print in the Journal of Planning Education and Research‘s forthcoming winter issue. We collected, validated, and analyzed 11 million Craigslist rental listings to discover fine-grained patterns across metropolitan housing markets in the United States.

Map of 1.5 million Craigslist rental listings in the contiguous U.S., divided into quintiles by each listing's rent per square foot. Published in JPER: the Journal of Planning Education and Research.

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
Tech

Describing Cities with Computer Vision

What does artificial intelligence see when it looks at your city? I recently created a Twitter bot in Python called CityDescriber that takes popular photos of cities from Reddit and describes them using Microsoft’s computer vision AI. The bot typically does pretty well with straightforward images of city skylines and street scenes:

Some are even kind of wryly poetic, such as this description of Los Angeles:

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
Planning

Craft Beer, Urban Planning, and Gentrification

I co-authored a chapter in the new book Untapped: Exploring the Cultural Dimensions of Craft Beer with the estimable Jesus Barajas and Julie Wartell. Our chapter is titled “Neighborhood Change, One Pint at a Time” and it explores the relationship between craft breweries, urban planning and policy, and gentrification.

We found that many cities have changed their zoning codes recently (and even offer subsidies) to make it easier to establish craft breweries and brewpubs, with the goal of economic development. There’s a strong narrative (and anecdotal evidence) of craft breweries “revitalizing” neglected neighborhoods. New breweries often seek inexpensive industrial spaces in close proximity to urban centers and residential districts. In turn, they serve as anchor institutions that appeal to whiter, wealthier, and more educated demographic groups. Many craft brewers explicitly see themselves as agents of neighborhood revitalization and “committed urbanists.”Ā The brewers we interviewed uniformly stated that neighborhood character was an important or even primary reason for their location choice, and many referred to themselves as pioneers and catalysts in neglected historic neighborhoods.

Locations of craft breweries and brew pubs across the United States. California, Colorado, Oregon, Washington, Michigan have the most craft beer locations.

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