Beruflich Dokumente
Kultur Dokumente
1 beta)
Users Guide
Last updated: 8 January 2014
Created by Melinda Morang, Esri
e-mail: mmorang@esri.com
For examples and updates, see http://transit.melindamorang.com
Data preparation
GTFS data
This tool requires a valid GTFS dataset, with or without an existing shapes.txt file. Use your own
GTFS data, or download a GTFS dataset for the transit authority you wish to work with. Check
the transit authoritys website or look at http://www.gtfs-data-exchange.com/.
Unzip the GTFS data into folders of your choice. A GTFS dataset should be a set of .txt files.
Warning: GTFS datasets can be very large.
Network Dataset
You need an ArcGIS Network Dataset with a streets network for the area covered by your transit
network. A streets network for the entire United States should be available in the Data &
Maps DVD you received from ESRI with your ArcGIS software. Note: You do NOT need a
network dataset that contains transit information.
Workflow
This tool contains two parts, and you may need to do some manual editing after the first part and before
the second.
The first step, Step 1: Generate Shapes on Map, generates a feature class of route shapes for your GTFS
data. The route shapes show the probable geographic paths taken by the transit vehicles along the
streets or tracks, or simply straight lines between stops in cases where on-street paths cannot be
calculated. Each unique sequence of stop visits in the GTFS data will get its own shape in the output
feature class.
The results of Step 1 are simply a reasonable starting point for your GTFS shapes. After running Step 1,
you can use ArcMap to manually edit the output feature class shapes as desired to ensure that the
shapes accurately reflect the paths taken by your transit vehicles.
When you are satisfied with the shapes in your feature class, run Step 2: Generate new GTFS text files to
create updated .txt files for use in your GTFS dataset. A shapes.txt file is created, and the trips.txt and
stop_times.txt files are updated.
Inputs
GTFS directory: The folder containing your (unzipped) GTFS .txt files. The tool uses the .txt files
directly, so you need not turn them into shapefiles or process them in any way.
Output directory: The folder where your output geodatabase will be written.
Name for output geodatabase: The name of your output geodatabase, which will be created
when the tool runs. The geodatabase must not currently exist.
Generate shapes that follow the streets for these route types (optional): This tool creates a
best guess for the geographic routes traveled by transit vehicles in your system. However, some
modes of transit, like subways, do not travel on the street network since they have their own
underground tracks. In this box, you should select which modes of transit should use the street
network to generate shapes.
Generate shapes by connecting stops with straight lines for these route types (optional): For
modes that dont travel along streets, you can choose to create shapes by drawing straight lines
between connected transit stops.
Network dataset: An ArcGIS network dataset that covers the area served by your transit system.
The network dataset does NOT need to contain transit information.
Impedance (cost) attribute: The network dataset cost attribute that will be used to compute the
likely routes of transit vehicles through your system. In general, you should choose an attribute
that makes sense for buses.
Which side of the road do your transit vehicles drive on? This determines which side of the
vehicle stops should fall on.
Where are U-turns at junctions allowed? Choose U-turn settings that make sense for your
transit system.
Network restrictions (optional): Choose any restrictions from your network dataset that make
sense for your transit vehicles.
Try to improve results by location stops on junctions instead of streets: Normally your transit
stops will snap to the closest non-restricted street feature in your network, and the Network
Analyst Route solver will find an optimal route visiting those locations. However, sometimes the
GTFS stop locations fall closer to a side street than to the main road where your transit route
actually travels, so the Route solver creates transit shapes that enter side streets and make Uturns or travel around blocks. You might be able to improve results by snapping your stops to
the closest network junction instead of to the closest street location. You should try the street
method first, and if you are unhappy with the results, try the junction method.
Outputs
A file geodatabase with the name and location you specified will be created and will contain the
following files:
Shapes: A lines feature class with your route shapes. You can edit these shapes before you use
them to create a shapes.txt file.
Stops_wShapeIDs: A feature class of your GTFS stops, including the shape_id field so you can
match them up with the shape they go to. In cases where the same GTFS stop gets visited by
multiple shapes, the Stops_wShapeIDs feature class will contain multiple copies of that stop,
one for each shape it is associated with.
SQLDbase.sql: A SQL database of your GTFS data. You shouldnt need to look at this for
anything, but dont delete it because it is necessary for running Step 2.
Inputs
GTFS directory: The folder containing your (unzipped) GTFS .txt files. The tool uses the .txt files
directly, so you need not turn them into shapefiles or process them in any way.
Output directory: The folder where your output geodatabase will be written.
Name for output geodatabase: The name of your output geodatabase, which will be created
when the tool runs. The geodatabase must not currently exist.
Generate shapes by connecting stops with straight lines for these route types: Straight-line
shapes will be created for these modes.
Which side of the road do your transit vehicles drive on? This determines which side of the
vehicle stops should fall on.
Where are U-turns at junctions allowed? Choose U-turn settings that make sense for your
transit system.
Outputs
A file geodatabase with the name and location you specified will be created and will contain the
following files:
Shapes: A lines feature class with your route shapes. You can edit these shapes before you use
them to create a shapes.txt file.
Stops_wShapeIDs: A feature class of your GTFS stops, including the shape_id field so you can
match them up with the shape they go to. In cases where the same GTFS stop gets visited by
multiple shapes, the Stops_wShapeIDs feature class will contain multiple copies of that stop,
one for each shape it is associated with.
SQLDbase.sql: A SQL database of your GTFS data. You shouldnt need to look at this for
anything, but dont delete it because it is necessary for running Step 2.
a big loop to turn around and visit the stop. These situations are sometimes hard to identify
because you cant see the areas where the shape line overlaps itself (see the picture on the
right). Once you identify them, however, its fairly easy to use the Reshape Features Tool to edit
them out. Sometimes, the bus legitimately travels the same road in both directions. When the
lines overlap exactly, it causes problems in Step 2 of the tool. The best way to handle this
situation is to use the Edit Vertices Tool to slightly separate the lines going in either direction so
that they no longer overlap.
If you ran Step 1 with the Try to improve
results by locating stops on junctions
instead of streets box checked True, you
will probably see fewer small side-road
diversions, but you might see some larger
unexpected results in areas with very
long street features. The nearest
network junction might actually fall on a
completely different street than the one
the stop is closest to, so the transit
vehicle will take a large detour or a
different route completely. The figure to
the right illustrates an example. The two
circled stops were far from the streets junction, and they located on dead ends far off the main
road, causing a large route diversion. You might be able to edit these out using the Reshape
Features Tool, or you might have to completely redraw the route by hand.
Inputs
Geodatabase created in Step 1: The file geodatabase that was created when you ran Step 1 of
this tool. It must contain the Shapes feature class as well as Stops_wShapeIDs and
SQLDbase.sql.
Directory for output GTFS text files: Designate an output directory where the new GTFS files
will be written.
Outputs
shapes_new.txt: The GTFS shapes.txt file generated from your Shapes feature class.
trips_new.txt: A copy of your original trips.txt file with the shape_id field added or modified to
match the new shapes.txt file.
stop_times_new.txt: A copy of your original stop_times.txt file with the shape_dist_traveled
field added or modified to match the new shapes.txt file.
After reviewing your new GTFS files, remove the _new suffix from the filenames and replace the
originals.
into side roads. More information about this problem can be found in the Common Shape
problems and how to fix them section of this document.
I got a warning message saying Warning! For some Shapes, the order of the measured
shape_dist_traveled for stops along the shape does not match the correct sequence of the
stops. This likely indicates a problem with the geometry of your shapes. The
shape_dist_traveled field will be added to your stop_times.txt file and populated, but the
values may be incorrect. Please review and fix your shape geometry, then run this tool again.
See the user's guide for more information. Similar to the problem above, if the shapes double
back on themselves, a transit stop might be equidistant to more than one point on the shape,
and the correct sequence of stops might not match the order of your shape_dist_traveled
values. This could indicate an underlying geometry problems in your shapes. It could also occur
when a transit shape legitimately traverses the same road in both directions.
I got a warning message saying Warning! Some shapes had no geometry or 0 length. These
shapes were written to shapes.txt, but all shape_dist_traveled values for the shape will have a
value of 0.0. This occurs if one of the shapes in your Shapes feature class has 0 length or no
geometry. This could occur if the transit line has only two stops, both of which are in the same
location. This is probably an error in the GTFS data.
If you are stuck, please e-mail me.