My favorites | Sign in
Project Logo
                
Search
for
Updated Mar 10, 2009 by ethan.henry
Labels: Documentation
KMLWriter  
Instructions for kmlwriter.

Introduction

The kmlwriter is a command line tool that plots the stops, trips and shapes defined in a Google Transit Feed as a KML file that can be viewed in Google Earth or any other application that uses KML files. Using it can help confirm that the stops and shapes are located in the right place. It also provides a 3d visualization of your trips that can help you find certain types of errors in your stop_times file.

Bart trips displayed with the --showtrips option

Installing

kmlwriter is part of the transitfeed distribution. Installation instructions for all operating systems can be found on the TransitFeedDistribution page. kmlwriter depends on ElementTree, which you might need to install manually.

Instead of installing the transitfeed distribution you may download http://googletransitdatafeed.googlecode.com/svn/trunk/python/kmlwriter.py and http://googletransitdatafeed.googlecode.com/svn/trunk/python/transitfeed.py to the same directory.

Running

Run the feed validator as

kmlwriter.py [options] <input GTFS filename> [<output KML filename>]

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -t, --showtrips       include the individual trips for each route
  -a ALTITUDE_PER_SEC, --altitude_per_sec=ALTITUDE_PER_SEC
                        if greater than 0 trips are drawn with time axis set
                        to this many meters high for each second of time
  -s, --splitroutes     split the routes by type
  -p, --display_shape_points
                        shows the actual points along shapes
  -d, --date_filter     restrict to trips active on date YYYYMMDD
  

The warning "Timezone not checked (install pytz package for timezone validation)" is normal. kmlwriter can not check the spelling of the agency_timezone until you install the pytz package.

Viewing

To view the resulting KML file, open Google Earth and choose the File > Open... command from the menu. Navigate to the save .kml file and Google Earth will plot the stops as place marks on the globe.

Revision History

See the TransitFeedDistribution page.


Sign in to add a comment
Hosted by Google Code