How can I build a spatially accurate network dataset with poor quality GTFS?

990
3
Jump to solution
01-31-2018 05:46 AM
Jan_PeterGlock1
New Contributor II

Dear Community,

I am working on an accessibility analysis and therefore need to construct a multimodal network dataset (including GTFS). I use ArcGIS Desktop 10.5 on a Windows machine, btw. I also uploaded a screenshot with an example of my problem: blue lines are the streets (osm), green lines are public transport routes (bus, tram, underground), purple lines are lines connecting stations with the street network, the green point is the stop/station from the GTFS file, orange triangles come from a more detailed point feature class representing stops/stations.


My problem is twofold: Firstly, I created a stops layer from a GTFS file using the EditGTFSStopLocation tool byMelinda Morang, which which gave me several point features per stop/station (green point feature); I guess one per public transport route (green line features) stopping at that station. However, these point features all have the same pair of coordinates. In theory, this means that bus, tram, train and so on stop at exactly the same position; no matter the direction of the route and no matter where they should actually stop. In reality, however, the points should be distributed like the orange triangles, each representing one “entrance/exit/platform” (in-)to a means of transport. Unfortunately, these points do not stem from the GTFS file and thus do not contain information on which route stops at them. Now I need to do a schedule aware analysis. Sounds like it is either schedule awareness allowing elaborating a precise waiting time OR positional accuracy allowing elaborating a precise walking time “in” the station. Does anyone see a way to get both?

The second problem is that neither the actual routes (green line features) nor the street network (OSM; blue line features) cross/coincide with the station. So, there is no connection between the different networks. (I attempted to solve that problem by connecting the stop point feature with the two nearest street features [see purple line features]. This would have to be repeated with the public transport feature classes.) Does anyone know a better, automated method to connect the line features with the point features - without connecting too many or the wrong features (like a tram stop with an underground line feature)?

Thanks everyone who read such a long post!


I am really looking forward to your responses

Thanks and best wishes,

Piet

PS: This is my first post in the community. Please tell me if it should be posted in another group. Thx!

0 Kudos
1 Solution

Accepted Solutions
MelindaMorang
Esri Regular Contributor

Hello Jan.

You do not need the geometry of your transit lines to match the OSM street geometry.  The Add GTFS to a Network Dataset toolbox will take care of this for you.  It will generate a feature class of transit lines which are simply straight-line connectors between stops.  The network dataset will reference these lines, but the travel times along those lines are calculated based on the GTFS schedules.  So the actual geometry of the lines is irrelevant.

The only thing that DOES matter is the location of the stops.  It seems like this is where your real problem lies.  Add GTFS to a Network Dataset finds the locations of all the stops from the GTFS stops.txt file, snaps a copy of the stops to the closest street feature, and draws a connector line from the snapped stop to the original stop location.  This allows you to connect from the streets onto your transit lines.  If the snapped stops don't end up in the right place, then the network will not correctly represent the locations where people can get on and off the transit system.

You can use the Edit GTFS Stop Locations tool to correct the locations of existing stops, export the correction back into GTFS, and then run Add GTFS to a Network Dataset using the corrected GTFS.  Another thing you can do is to add station entrances to your GTFS stops.txt file.  To do this, you would add a new entry to stops.txt and give it a location_type value of 2.  You would also have to have a parent_stations set up.  Read the GTFS reference for the explanation.  If you have your stops, parent stations, and station entrances set up correctly, the Add GTFS to a Network Dataset toolbox will take care of constructing the network dataset correctly using that information.  Also, adding station entrances does not affect the GTFS schedules, so you can add them without having to do any major surgery on your GTFS dataset.

Hope this helps!

View solution in original post

3 Replies
MelindaMorang
Esri Regular Contributor

Hello Jan.

You do not need the geometry of your transit lines to match the OSM street geometry.  The Add GTFS to a Network Dataset toolbox will take care of this for you.  It will generate a feature class of transit lines which are simply straight-line connectors between stops.  The network dataset will reference these lines, but the travel times along those lines are calculated based on the GTFS schedules.  So the actual geometry of the lines is irrelevant.

The only thing that DOES matter is the location of the stops.  It seems like this is where your real problem lies.  Add GTFS to a Network Dataset finds the locations of all the stops from the GTFS stops.txt file, snaps a copy of the stops to the closest street feature, and draws a connector line from the snapped stop to the original stop location.  This allows you to connect from the streets onto your transit lines.  If the snapped stops don't end up in the right place, then the network will not correctly represent the locations where people can get on and off the transit system.

You can use the Edit GTFS Stop Locations tool to correct the locations of existing stops, export the correction back into GTFS, and then run Add GTFS to a Network Dataset using the corrected GTFS.  Another thing you can do is to add station entrances to your GTFS stops.txt file.  To do this, you would add a new entry to stops.txt and give it a location_type value of 2.  You would also have to have a parent_stations set up.  Read the GTFS reference for the explanation.  If you have your stops, parent stations, and station entrances set up correctly, the Add GTFS to a Network Dataset toolbox will take care of constructing the network dataset correctly using that information.  Also, adding station entrances does not affect the GTFS schedules, so you can add them without having to do any major surgery on your GTFS dataset.

Hope this helps!

Jan_PeterGlock1
New Contributor II

Hi Melinda,

thanks for your detailed response. You are right about the geometry of the transit lines. Except for when I want to create a map with the transit lines as representation of the "real world". But thats something I'd figure out once I need to.

I will now try to edit the GTFS stops.txt file itself, according to your instructions and using your tools. I will report back once I am done and it worked. However, I wonder how  "Add GTFS to a ND" allocates the transit lines to the different stops (location type 1) that I add manually to the parent station. Wouldn't I need to change the routes.txt aswell, for the tool to know that bus X stops at stop 1 of a station, while Bus Z stops at stop 2 of the same station?

Another thought: my case is limited to a medium sized city (400k inhabitants) and I wonder how someone working with a large dataset from, lets say, NYC would handle my "stops problem".

Anyway, thanks a lot Melinda!

Piet

0 Kudos
MelindaMorang
Esri Regular Contributor

If you want to render the transit routes in the map, you should use the Display GTFS in ArcGIS tool, which renders the information in "shapes.txt".  This is the physical representation of where the transit lines actually are.

Regarding your question about larger cities: The producer of the GTFS data is responsible for generating accurate data.  If the stops are in the wrong place or station entrances are not represented, then consumers of that data should ask the data producer to fix the problem.    In your case it might be faster to fix it yourself, but you're right that for a large city, it would be very time consuming to edit it yourself as a one-off.

0 Kudos