Friday, 28 August 2015

Mapping the American Commute

Update, 20 September 2015: scroll to the bottom of the post if you want to download the data.

One of my summer projects this year has been attempting to map the American commute, following earlier work on a similar subject. Put simply, I've attempted to put together a map which shows commuting connections between locations in the contiguous United States, using the most fine-grained data I could find. Some of the results of this went into a recent piece in WIRED, and also CityMetric, and the larger piece of work it's based on is part of on-going research into the best ways of mapping commuting flows. The main images are below, followed by some more technical information. For now, all you need to know is that these images show commuting connections of 100 miles or less between Census tracts in the lower 48 states. You'll have to forgive me if your city isn't labelled! 

Higher resolution image available here

And now some zoomed in versions...


Zoom in of the west coast

Texas, and beyond!

Interesting patterns of connectivity in the Midwest


Look closely for some interesting inter-connections



The famous BosWash megalopolis

But this just shows where people live, doesn't it? Yes it does. But it also shows how the places where people live connect with other places from a functional economic point of view, at a fairly fine-grained level. It offers a slightly different view than just looking at the urban fabric alone which, I might add, is interesting in itself. Mapping flows like this is not exactly new, as this paper from Arthur Robinson (1955) on Henry Drury Harness (1837) demonstrates. Nonetheless, I haven't seen anyone map travel to work at this resolution for the United States, so I thought I'd have a go myself. 

If you spend some time looking at the big version of the map you can begin to see how places connect and where there are obvious disconnections, even between places that are not that far apart. One thing that you can pick up from the complete dataset (but not this batch of maps) is the growth of mega-commuting, as explained by Melanie Rapino and Alison Fields of the United States Census Bureau. 

Background information: the data I used is the most recent tract-to-tract journey to work dataset from the American Community Survey. This dataset covers journeys to work between the c74,000 census tracts in the United States and the complete dataset has around 4million interactions. I mapped this in QGIS, using methods I've described previously on this blog. The tricky bits were dealing with the messy FIPS codes, dealing with the size of the dataset, and trying to decide what to label. There is quite a bit of error in the dataset (as acknowledged by the ACS people) and each individual flow line has a margin of error value associated with it, from which I also calculated the coefficient of variation. This is explained in a more detailed working paper, which I expect to publish in the coming months.

Update, 20 September 2015: there has been quite a bit of interest in the underlying dataset I put together to create the maps, so I have decided to make the whole shapefile available here in the hope that others will find it useful and be able to produce some interesting analysis or visuals from it. I'm hoping someone will do a cool interactive web map of it, but it might be quite technically challenging. If you do use it, make sure you read the associated working paper, which explains the process and the underlying data. One word of warning: the uncompressed file is pretty big so you'll need a good computer.

Mapping the American Commute: download the data (213MB, zipped shapefile)



Tuesday, 4 August 2015

"The Regional World", version 2

I recently came back to CartoDB to do a bit of experimenting for some GIS work I'm doing this autumn, so I decided to revisit a topic I looked at before: sub-national regions of the world. In a previous version I posted via Twitter I took sub-national boundaries of the world and put together an interactive map (in about 15 minutes, so it wasn't very good). I've now produced a better one. It's not perfect but I have managed to add in an equal area projection version and other simple features - such as scale-dependent labelling and line styling.

The Regional World - version 2

According to Wikipedia, the largest sub-national divisions in the world are the Sakha Republic (Yakutiya) in Russia, Western Australia, and Krasnoyarsk Krai, also in Russia. The first two are more than ten times the size of the UK (which is 244,000 sq km) and number three almost is. If you click on the link above to go to the map then you'll see that you can also click on the equal area version. I did this because web maps often default to the Mercator projection, which causes massive distortion towards the poles and leads people into thinking Greenland is bigger than Africa, which of course it isn't.

The Regional World - equal area projection

The equal area projection does of course mean that areas towards the poles are extremely distorted, but that's part of the deal with some map projections. I've taken the administrative boundaries at face value, but of course they may not be 100% accurate, as the authors of the data acknowledge:

"This is the toughest dataset to keep current. Unlike the United States, other countries constantly rearrange their admin-1 units, slicing and combining them on a regular basis."

Read more about the data

You'll notice that I have put links to a small number of countries on the main map. I chose these because I find them interesting, that's all. This was part experiment with CartoDB and a little SQL (projection) and CSS (scale-dependent styling), part GIS project, part teaching material, partly driven by my interest in regions more generally, and part pre-holiday wind-down. In relation to the latter, just for fun, I have hidden two little artefacts in the main map that only appear when you zoom to a certain level at two places on earth. 

Can you find them? 

Answers via Twitter or e-mail...