Category: Information

How to upload shapefiles to Google Fusion Tables

It is now possible to upload a shapefile (and its companion files SHX, PRJ, and DBF) to Google Fusion Tables (GFT).

Before we go any further, keep in mind that the application that does this will only process 100,000 rows. Additionally, GFT only gives each user 200 MB of storage (and they don’t tell you your current status, that I can see).

  1. Login to your Google account (at Gmail, or at GFT).
  2. Prepare your data. Ensure it has fewer than 100,000 rows.
  3. ZIP up your dataX.shp, dataX.shx, dataX.prj, and dataX.dbf. Use WinZip for Windows, or for Mac, right-click the selection of files and select “Compress 4 items”.
  4. Visit the Shape to Fusion website. You will have to authorize the web application to “grant access” to your GFT tables. It needs this access so that after the web application processes your data, it can insert it into GFT.
  5. If you want a Centroid Geometry column or a Simplified Geometry column added, click “Advanced Options” and check their checkboxes – see notes below for an explanation.
  6. Choose the file to upload and click Upload.
  7. Leave the window open until it says it has processed all of the rows. It will report “Processed Y rows and inserted Y rows”. You will be given a link to the GFT the web application created.

Sample Data

If you’re looking to give this a try and see results quickly, try some sample data from the City of Chicago data portal:

Notes

I had trouble many times while using Shape to Fusion in that after I chose the file to upload and clicked Upload, I had to grant access to the web application again and start over (choose the file and click Upload a second time).

Centroid Geometry – This creates a column with the geographic coordinates of the centroid in a polygon. It lists it in the original projection system. So if your projection is in feet, the value will be in feet. This is a function that can easily be performed in free and open source QGIS, where you can also reproject files to get latitude and longitude values (in WGS84 project, EPSG 4326). The centroid value is surrounded in the field by KML syntax “<Point><coordinates>X,Y</coordinates></Point>”.

Simplified Geometry – A geometry column is automatically created by the web application (or GFT, I’m not sure). This function will create a simpler version of that geometry, with fewer lines and vertices. It also creates columns to list the vertices count for the simple and regular geometry columns.

Introduction to DIY bike ridership research

A lot of people ask me how many people are out there bicycling.

“Not a lot”, I tell them.

And I explain why: the primary source of data is the American Community Survey, which is a questionnaire that asks people questions about how they got to work in a specific week. (More details on how it does this below.) We don’t have data, except in rare “Household Travel Surveys”, about trips by bike to school, shopping, and social activities.

It’s comparable across the country – you can get this data for any city.

Here’s how:

  1. Visit the “legacy” American FactFinder and select American Community Survey, operated by the United States Census Bureau.
  2. Select 2005-2009 American Community Survey 5-Year Estimates (or the latest 5-year estimate). This is the most accurate data.
  3. In the right-side menu that appears, click on “Enter a table number”.
  4. In the new window, input the table number ” S0801″ (“Commuting Characteristics by Sex”) and submit the form. The new window will close and the other window will go to that table.
  5. Now it’s time to select your geography. In the left-side menu, under “Change…” click on “geography (state, county, place…)”
  6. In the window to change your geography, select “Place” as your “Geographic Type”.
  7. Then select the state.
  8. Then select your city and click “Show Result”.
Notes:
  • This data shows all modes people take to work, who live in that city. It’s highly probable that people are leaving the city to their jobs on these modes. For example, someone who lives in Rogers Park may ride their bike to work in Evanston.
  • The URL is a permanent link to this dataset. Each city has a unique URL. You should save these as bookmarks so you can easily reference the data later.
  • The question on the survey doesn’t allow multiple choices: “People who used more than one means of transportation to get to work each day were asked to report the one used for the longest distance during the work trip”.

Using Google Fusion Tables to create individual Chicago Ward maps

I wanted to create a map of the 35th Ward boundaries using Google My Maps for a story on Grid Chicago. I planned to create this by taking the Chicago Wards boundary shapefile and exporting just the 35th Ward using QGIS into a KML file. I ran into many problems and ended up using Google Fusion Tables as the final solution.

The problems

First, QGIS creates invalid KML files. Google Earth will tell you this. I opened the KML file in a text editor and removed the offending parts (Google Earth mildly tells you what these are; you can use this validator to get more information).

Second, Google My Maps would not import the KML file. I tried a different browser and a different KML file; a friend ran into the same issue. I reported this problem to Google.

The solution

I uploaded to Google Fusion Tables a KML file containing all wards. I did this instead of uploading the single Ward because, like a database, I can filter values in the column, selecting only the row I want with “ward=35”.

After applying the filter, the map will show the boundary for just that ward. I grab the HTML code for an embeddable map and voila, the article now displays an interactive map of the 35th Ward.

Whenever I want to create a map for a different ward, I go back to this Fusion Table, make a new filter and copy the new HTML code.

A screenshot of the embedded map, showing just 1 of 50 wards, in the Grid Chicago article. 

Elsewhere

I had the same problems with QGIS exporting and uploading the KML files to My Maps the other day when I was creating maps for the abandoned railroads for Monday’s Grid Chicago article. Not thinking about Fusion Tables, I drew on the map with my mouse the lines.

Screenshot of the map of abandoned railroads. 

Policy insight for Monday, August 1, 2011

This isn’t refined. These are just my notes that I speak from. I may not have spoke about everything written here and I may not have written here everything I spoke about. This is for Moving Design

There was report of cyclist crashing on the Tuff Curb at the on-street bike parking facility in Wicker Park.

Installing the Tuff Curb

experimental projects need reviews. I don’t mean projects that are considered experiments, I mean projects that are new to the people who designed it, and new to the people who will be using it.

we need good data collection.

Did the Kinzie bike lane cause congestion? So what if it did?
We would need data points that were collected using well-known methods, and probably at different times of the day and week. And we’d have to be sure to count cyclists, too.
Then 3, 6, or 12 months later, we’d have to do it again.

What was the change?
Is that a change that meets our goals?

Back to the cyclist crashing on tuff curb, what is the city’s plan to monitor the use (or disuse) of the facility? How will the city collect data on something like this?

Census – not gonna happen in 2020
American Community Survey – 5-year estimates (with data gathered annually) will replace decennial Census.

“Here are a few Streetsblog posts about Census and NYC DOT’s bike counts, and the problems with each. The first post has some stuff about what could be done to improve on them:” (Ben Fried, Editor in Chief, Streetsblog NYC)

http://www.streetsblog.org/2010/04/27/how-many-new-yorkers-bike-each-day/
http://www.streetsblog.org/2010/10/01/did-nyc-bike-commuting-decrease-in-2009-thats-what-the-census-says/
http://www.streetsblog.org/2011/04/13/actually-if-you-build-it-they-will-bike/

Read more policy insights from Steven Vance. 

Carnage culture: Extrapolating blood alcohol content levels

A breathalyzer test, to measure an automobile driver’s Blood Alcohol Content (BAC), is not always administered at the time and scene of a crash. I don’t know why it took four hours for Drew Forquer to have his BAC measured, but it registered at 0.045 percent, slightly more than half the legal limit of 0.08 percent.

Drew was convicted on Friday, June 17, 2011, of reckless homicide and aggravated drunken driving, but not “aggravated DUI charges that specified he was over the legal limit.”

…but the judge said it was clear to him simply from the results of field-sobriety tests, eyewitness testimony and Forquer’s “bizarre” turn — which was caught on surveillance video — that he was impaired.

The prosecution hired an expert witness to extrapolate Drew’s BAC at the time of the crash, “estimated…to be from 0.084 to 0.123 percent.”

What extrapolation means

Using evidence, prosecution and defense argue about the estimated BAC based on a variety of factors, including:

  • witness statements about driving behaviors (prosecution)
  • evidence of drinking before or during crash (prosecution)
  • field sobriety test (prosecution)
  • individual’s metabolism (defense)
  • “what the driver ate or drank that day” (defense)
  • other health issues (defense)

(The parentheses indicate which side used the factor in Drew Forquer’s case.)

In Drew’s case, his defense attorney argued that the BAC was lower because him having liver disease and chronic alcoholism would have slowed his metabolism (meaning alcohol would enter the blood stream more slowly).

Drew awaits sentencing, which can be from probation to 15 years in prison. They must be joking about probation – he’s gone to court for four previous DUI arrests!

More carnage culture articles

Story sources

Chicago Tribune – Thursday, June 16, 2011

Chicago Tribune – Friday, June 17, 2011

A taxi driver exited Lake Shore Drive and drove across the grass separating it from the Lakefront Trail. This photo, taken on July 4, 2010, is not related to the story above. Photo by Andrew Ciscel.