Category: Information

How to convert GTFS to GIS shapefiles and KML

This tutorial will teach how you to convert any transit agency’s General Transit Feed Specification (GTFS) data into ESRI ArcGIS-compatible shapefiles (.shp), KML, or XML. This is simple to do because GTFS data is essentially a collection of CSV (comma separated values) text files (really, really large text files).

Note: I don’t know how to do the reverse, converting shapefiles or other geodata into GTFS data. I’m not sure if this is possible and I’m still investigating it. If you have tips, let me know.

Converting GTFS to GIS shapefiles

Instructions require the use of ArcGIS (Windows only) and a free plugin called ET GeoWizards GIS for any version of ArcGIS. I do not have instructions for Mac users at this time.

I wrote these instructions while converting the Chicago Transit Authority’s GTFS files into shapefiles based on a reader’s request. “Field names” are quoted and layer names are italicized.

  1. Download the GTFS data you want. Find data from agencies around the world (although not many from Europe) on GTFS Data Exchange.
  2. Import into ArcGIS the shapes.txt file using Tools>Add XY Data. Specify Y=lat and X=lon
  3. Using ET GeoWizards GIS tools, in the Convert tab, convert the points shapefile to polyline.
  4. Select the shapes layer in the wizard, then create a destination file. Click Next.
  5. Select the “shape_id” field
  6. Click the checkbox next to Order and select the field “shape_pt_sequence” and click Finish.
  7. Depending on the number of records (the CTA has 466,000 shapes), it may take a while.
  8. The new shapefile will be added to your Table of Contents and appear in your map.
  9. Import the trips.txt and routes.txt files. Inspect them for any NULL values in the “route_id” field. You will be using this field to join the routes and trips table. It may be a case that ArcGIS imported them incorrectly; the text files will show the correct data. If NULL values appear, follow steps 10 and 11 and continue. If not, follow steps 10 and 12 and continue. This happens because ArcGIS inspected some of the data and determined they were integers and ignored text. However, this is not the case.
  10. Export the text files as DBF files so that ArcGIS operates on them better. Then remove the text files from the Table of Contents.
  11. (Only if NULL values appear) Go into editing mode and fix the NULL values you noticed in step 9. You may have to make a new column with a more forgiving data type (string) and then copy the “route_id” column into the new column. Then continue to step 12.
  12. Join routes and trips based on the field “route_id” – export as trips_routes.dbf
  13. Add a new column to shapes.shp called “shape_id2”, with data type double 18, 11. This is so we can perform step 14. Use the field calculator to copy the values from “shape_id” (also known as ET_ID) to “shape_id2”
  14. Join routes_trips with shapes into routes_poly based on the field “shape_id” (and “shape_id2”)
  15. Dissolve routes_poly on “route_id.” Make sure all selections are cleared. Use statistics/summary fields: “route_long,” “route_url.” Save as routes_diss.shp
  16. Inspect the new shapefile to ensure it was created correctly. You may notice that some bus routes don’t have names. Since these routes are well documented on the CTA website, I’m not going to fill in their names.

Click on the screenshot to see various steps in the tutorials.

Converting GTFS to KML

After you have it in shapefile form, converting to KML is easy – follow these instructions for using QGIS. Or if you want to skip the shapefile-creation process (quite involved!), you can use KMLWriter, a Python script. Also, I think the latest version of ArcGIS has built-in KML exporting.

Converting GTFS to XML

If you want to convert the GTFS data (which are essentially comma-separated value – CSV – files) to XML, that’s easier and you can avoid using GIS programs.

  • First try Mr. Data Converter (very user friendly).
  • If that doesn’t work, try this website form on Creativyst. I tested it by converting the CTA’s smallest GTFS table, frequencies.txt, and it worked properly. However, it has a data size limit. (User friendly.)
  • Next try csv2xml, a command line tool. (Not user friendly.)
  • You can also use Microsoft Excel, but read these tips and caveats first. (I haven’t found a Microsoft application I like or think is user friendly.)

Verifying LEED certification and eco-friendly features

Read more commentary on LEED certification.

If a building claims it has environmentally friendly features (is that the same as eco-friendly?) but hasn’t applied for and received LEED certification, should we still call it “green”?

I’m talking specifically about Emerald, a two-tower (mid-height) condominium development on Green Street in Chicago’s Greektown/West Loop neighborhood. I watched its construction from beginning to end because I passed it daily on my commute to work.

The development’s sales website claims that because it sits on Green Street, it’s “naturally eco-friendly.” The website says the building has “bamboo flooring, low-VOC paint and beautiful fabrics made from recycled fiber. Even our marketing materials utilize recycled paper manufactured with windpower and printed with soy inks.”

These scaffold panels are advertising office space in a new tower that has since been built on this site. The one on the right reads “Reflect the social conscience of your organization.” Photo by Payton Chung.

Additionally, it has a 4-pipe HVAC system versus an “inferior” 2-pipe system, and high efficiency windows.

But I looked in the U.S. Green Building Council’s (USGBC) Certified Project Directory and didn’t find a project named “Emerald.” Let’s assume my search and the results are correct and Emerald does NOT have LEED certification. Are the claims on the website accurate? How can we trust that the paint truly has less volatile organic compounds?

If it was LEED certified would we trust it more then?

The building advertised in the photo above, 300 N LaSalle, received two certifications: Silver in Commercial Interior, and Gold in Core & Shell. The advertisement’s claims have some verification, but how trustworthy? My photo.

I’m not a LEED AP (Accredited Professional), but I understand that LEED certification requires thorough documentation. After a review of your application and submittals (essentially an audit), the USGBC makes its determination. I don’t believe anyone representing the USGBC inspects the building.

We then have to question why the Emerald developers didn’t seek LEED certification. Or did they?

Metra 35th St. station surely won’t win any design awards

UPDATE 04-07-11: The station opened on April 3, 2011. Blair Kamin explains why it doesn’t look as good as originally designed:

It didn’t have to be this way. The Chicago office of Skidmore, Owings & Merrill came up with a promising design for the station, one that justified the demolition of a Mies-designed brick hut that reportedly served as the entrance to an underground testing facility for explosives during the Cold War.

But then, things went seriously off the rails.

This new Metra commuter/regional rail station at 35th Street and Wentworth/Federal won’t win any design awards. Neither will the Lovana S. “Lou” Jones/Bronzeville Station stand out for having such a generic design.

The station under construction as of October 3, 2010.

Artist’s renderings of the station and street-level plaza, looking northwest. Left photo from Metra’s website and right photo from Singh & Associates’s website.

The amount of visible concrete used in the stairs and ramps construction (one complete set on either side of the tracks) is fitting if you consider the station’s surroundings: a 12-lane highway (the Dan Ryan, I90/94), thousands of surface auto parking spaces to the west (for the White Sox stadium), and an empty lot.

But what if we looked for design inspiration from the east?

Imagine a station shelter modeled after the sound mitigation “tube” over the Illinois Institute of Technology McCormick-Tribune Campus Center a few blocks away at State Street designed by Rem Koolhaas.

Photos above taken by Steven Crane.

Throw in some curves like the Canary Wharf stations on the Jubilee and Docklands Light Railway lines.

Photo of the Canary Wharf Docklands Light Railway (DLR) station by stephenk1977.

Photo of the Canary Wharf Jubilee Underground Line station by Payton Chung.

Companies involved:

Chicago and Illinois construction updates, October 2010 edition

This post will be updated as I receive more information and shoot more photos. Please contribute your own updates and news.

  • High-speed rail in Illinois – Yes, America is building some “high-speed” rail (for the second time). The first leg of track replacement is from Springfield to Alton (across the Mississippi River from St. Louis). I am really interested in renting a car and driving down here to see it for myself.
  • 31st Street harbor/marina – Originally introduced on my blog in July and again in August. The Chicago Park District is developing a full marina, including a boat ramp and restaurant.
  • Sustainable streetscape in Pilsen – A water feature and bioswale was recently installed at Benito Juarez Community Academy on Cermak Road. I’ve been told it’s especially fantastic during the rain, as the water is collected from the roof, pours down a spout into a small creek.
  • 35th Street Metra station – Originally introduced on my blog in July. The line will help my roommate get to his old neighborhood faster. Oh, it will improve access to the White Sox stadium, hopefully helping to reduce idling and congestion on the Dan Ryan expressway and our neighborhood roads that get backed up during baseball games.

31st Street Beach and harbor construction.

Do you have construction updates for your city or state?

High-speed rail under construction in Illinois

UPDATE: The City of Carlinville Facebook page provides consistent and timely updates on the railroad crossing closures while the Union Pacific track is upgraded. The City posted photos, too.

If you weren’t specifically seeking out information on high-speed rail (HSR) construction, and you weren’t searching for “track renewal train” and other obscure keywords, you wouldn’t actually know about the status of HSR.

But that’s why you follow my blog – I’ll keep you updated.

Right now, crews are working 10 hour days, working 10 days on, and 5 days off* in Carlinville, Plainview (photo), and Alton, Illinois, to remove existing track and wooden ties and replacing them with concrete ties and continuously welded rail (CWR).

The proof is in the videos, taken only four days ago in Carlinville (map) on October 1, 2010. Watch more videos from PSQLead.

The Harsco Track Technologies Track Renewal Train 909 (TRT-909) does the following:

  • Picks up and carries out of the way old rail
  • Removes old wooden ties with a robot arm
  • Digs up ballast
  • Places new concrete ties
  • Drops in new rail and heats it so it can be “continuously welded”
  • Clamps new rail to new ties

What the beast looks like from afar. Photo of Union Pacific’s TRT-909 in Aldine, Texas, by Matthew Holman.

Thankfully Illinois doesn’t have a growing anti-rail political force like Ohio, California, Florida, or Wisconsin. All of these states have Republican candidates running for governor who say they will stop the train in its tracks. Read more about this unfortunate situation in The New York Times.

*This information comes from a secondary source. I hope to get in touch with someone who knows more about the work.