(Download this KML at the bottom of the page... read the warning ;P)
Datasets
- County and State-level data for 1900-1990 census population counts (described and also available here) were found in compiled form here at the National Bureau of Economic Research
- 2000 & 2010 County and State data was downloaded from queries on the US Census American FactFinder #2 page
- Data on houses lacking indoor plumbing (1940-1990) was found here
- Data on citizens and children lacking health insurance (1987-2009) was found here and here
Most of this data was pretty messy, in a number of different formats (Excel, csv, raw text) and required a lot of scrubbing. I used Google Refine, Excel and Open Office Calc and good ol' Notepad++ to massage this data into a usable format (CSV).
I then found state and county polygon data on Google Fusion Tables. By maintaining the FIPS codes for all the states and counties in the Census/ACS data, merging with the geometries in Fusion Tables was pretty easy. I then downloaded a master CSV file from Fusion Tables that had a row for each state/county, and columns for each of the time-series values.
Here is the Fusion Table of all the raw data I used to make the map: raw data
To generate a KML from this csv file I used the python-based pyKML library, developed by Tyler Erickson. It is based on lxml's Objectify API, and supports schema validation against the KML XSDs. I’ll try to share some code snippets once I clean it up... right now it’s a bunch of spaghetti :)
I also used the Google Charts API Wizard to dynamically generate graphs for each state/county during the animations (you must start the tour, pause or wait until the end and then click on a polygon to see the chart). This was made possible by a lot of <BalloonStyle> + <ExtendedData> hackery (see this tutorial).
The final product is almost 650K lines of KML including 200K+ polygon vertices and point coordinates!
Ultimately, we need to add a feature to KML that allows you to associate altitudes with timestamps, like the way <gx:Track> works. But in the mean time, this will do :)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAV3c12vl7wWcbLCnQ6uzHxXWIN3j5Uzi2M30gJqtFfUCLSwqKdD6-bqmK3qH4EKEWT5QjB6BMkaDWeBD-tLtwFl-Z2PEPwF8p2yuKNfDDeG12p86EuxU7VyqC3OamjromOrmwxL8hSPIM/s320/census_pop.jpg)
U.S. Population by State
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyNloIjV7OB_lCinC1KB3aK5m0ZT1FGVPMtMyVLAaaqkLXefv1L3YG41VBXjaCpIHEhxze6KWdy9IY_7osPf_6XYBvdPo9VJgRPud-USF-XMWk5EBK89bRjv69vzaJH4NQcjcD1T_X6laY/s320/county_pop.png)
California Population by Counties
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNymPaqaLxxHo0MFYrZb87Jj97c3smo_mVl6tgPnxjsAONuqX8p6UxbTiUsncCuPFFbeV3BFeSGeNOYSBIRN-fJYEOSWUcQK8wdSajpayxQFJm6Z0kQrnJRQ4c8kgQDnkylSjg-DMMLosA/s320/insurance_children.jpg)
Percent of children lacking health care in 1987 by State
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZ2YuceqQgqFRiz9DSvtKv5eFqW7CD5PUA_1eHxtDbH4NxtRsbeX9LybRaioxLUnPFyVeF3bO2Prl2O2ZaZdoMAmK_YYRFtueaXLhyoLe-4aH8zal61Uly5dJa4OhXU2uqCa-E2r12CRK6/s320/insurance_texas.jpg)
Chart API for children without health insurance in 1994 in Texas
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKely0OiB_I7QNrA-lU1JPQ64fJHdulwavjpExZ8voKu73pYjhV3EIEQhpaOrkOix0qX8wKxSgurJ7KabGbYFnZcptfLLA_RluucuAPNWLt49a16PR0SUm39Qota0UqQw7MU1hS-XRa87R/s320/plumbing.jpg)
Percent of homes without complete indoor plumbing 1940
Warning: This is a massive KML (3MB compressed, 33MB uncompressed). The "Population (1900-2010) (County)" Tour is particularly cumbersome for laptops/older computers, because there are 3000+ animated county polygons. Click on the tour in the left hand panel to view the data.
Here are some of the KML tags I used to make this:
No comments:
Post a Comment