Generate transit lines and stops ERROR

477
6
Jump to solution
09-09-2018 09:37 PM
Labels (1)
ALEXBARTZOKAS
New Contributor II

Hi there!

I used the Add GTFS to network dataset toolbox, and I tried to create the transit lines and stops feature layers. I tested the tool with several GTFS datasets but in some of them failed to execute the lines and stops successfully... Here I quote the error message:

Executing: GenerateTransitLinesAndStops C:\Users\alex_\Desktop\D4i_Sept18\CITIES\HAMBURG\Upload__HVV_Rohdaten_GTFS_Fpl_20170810 C:\Users\alex_\Desktop\D4i_Sept18\CITIES\HAMBURG\Hamburg_data.gdb\hamburg_gtfs
Start Time: Mon Sep 10 07:14:44 2018
Running script GenerateTransitLinesAndStops...
SQLizing the GTFS data...
(This will take a few minutes for large datasets.)
Generating transit stops feature class.
Failed to generate transit lines and stops.
Failed script GenerateTransitLinesAndStops...

Traceback (most recent call last):
File "c:\program files (x86)\arcgis\desktop10.3\ArcToolbox\Toolboxes\scripts\GenerateStopPairs.py", line 205, in <module>
c.execute(selectstoptablestmt)
OperationalError: no such column: wheelchair_boarding

Failed to execute (GenerateTransitLinesAndStops).
Failed at Mon Sep 10 07:16:56 2018 (Elapsed Time: 2 minutes 12 seconds)

So, please let me know if there is a solution to this kind of error ...

Thanks!

0 Kudos
1 Solution

Accepted Solutions
MelindaMorang
Esri Regular Contributor

Hello Alex.  Several others have complained of this problem.  It happens when you do not have a "wheelchair_boarding" column in your input stops.txt file.

However, the tool should work in this situation, as wheelchair_boarding is not required.  I thought I had fixed this problem, and when I just tested it here on my own machine, I did not get an error.

Please download and install the latest version of the tool: http://arcg.is/10jXez 

See if this resolves the issue.  If it does not, can you share your GTFS dataset with me so I can see what causes the error and fix it?

(If you're in a hurry, the fastest way for you to get it working is to just add a column to stops.txt called wheelchair_boarding.  You don't need to give it any values.)

View solution in original post

0 Kudos
6 Replies
MelindaMorang
Esri Regular Contributor

Hello Alex.  Several others have complained of this problem.  It happens when you do not have a "wheelchair_boarding" column in your input stops.txt file.

However, the tool should work in this situation, as wheelchair_boarding is not required.  I thought I had fixed this problem, and when I just tested it here on my own machine, I did not get an error.

Please download and install the latest version of the tool: http://arcg.is/10jXez 

See if this resolves the issue.  If it does not, can you share your GTFS dataset with me so I can see what causes the error and fix it?

(If you're in a hurry, the fastest way for you to get it working is to just add a column to stops.txt called wheelchair_boarding.  You don't need to give it any values.)

View solution in original post

0 Kudos
SakshiKosta
New Contributor

Hi Melinda! 

I am trying to use Add GTFS to a Network Dataset toolbox for a project and I am unable to get through this error. Can you please have a look and help me? The error message is like this: 

Traceback (most recent call last):
File "c:\program files (x86)\arcgis\desktop10.6\ArcToolbox\Toolboxes\scripts\GenerateStopPairs.py", line 428, in <module>
arcpy.management.PointsToLine(outStopPairsFC, outLinesFC, "pair_id", "sequence")
File "c:\program files (x86)\arcgis\desktop10.6\arcpy\arcpy\management.py", line 2977, in PointsToLine
raise e
ExecuteError: ExecuteError: ERROR 000622: Failed to execute (Create Feature Class). Parameters are not valid.
ERROR 000628: Cannot set input into parameter spatial_reference.
Failed to execute (PointsToLine).


Failed to execute (GenerateTransitLinesAndStops).

My GTFS Dataset is here 

Looking forward to your response. 🙂 

0 Kudos
MelindaMorang
Esri Regular Contributor

Hello SakshiKosta. Unfortunately, the Add GTFS To A Network Dataset tool is now deprecated, so I am not able to provide extensive assistance with it.

From the error message, it looks like there might be a problem with the spatial reference you have chosen for your feature dataset.  I suggest starting over with a new file geodatabase and feature dataset. Make sure to carefully select a valid spatial reference for the feature dataset, and then try again.

In general, though, I recommend you switch to using ArcGIS Pro for your transit-related analyses.  We have made equivalent tools available in the core product, and these tools are more modern and thoroughly tested, and you can get help on them from Esri Support.  Learn more.

MelindaMorang
Esri Regular Contributor

Did updating the tool work, or are you still having the problem?

0 Kudos
ALEXBARTZOKAS
New Contributor II

Dear Melinda,

I added a column wheelchair_boarding in stops.txt (as you suggested), but the tool didn't work.

So, I get the following error: 

Executing: GenerateTransitLinesAndStops C:\Users\Alex\Desktop\HSR_D4i\Spain_RenfeLongDistance C:\Users\Alex\Desktop\HSR_D4i\SpainRENFE.gdb\LinesStopsRENFE
Start Time: Mon Feb 18 23:25:52 2019
Running script GenerateTransitLinesAndStops...
SQLizing the GTFS data...
(This will take a few minutes for large datasets.)
GTFS table stops contains at least one row with the wrong number of fields. Fields: [u'stop_id', u'stop_code', u'stop_name', u'stop_desc', u'stop_lat', u'stop_lon', u'zone_id', u'stop_url', u'location_type', u'parent_station', u'stop_timezone', u'wheelchair_boarding']; Row: (u'SpainRenfeLongDistance:71801', u'', u'Barcelona-Sants', u'', u'41.379520', u'2.140624', u'SpainRenfeLongDistance:', u'', u'', u'', u'Europe/Madrid')
Failed to generate transit lines and stops.
Failed script GenerateTransitLinesAndStops...

Traceback (most recent call last):
File "c:\program files (x86)\arcgis\desktop10.3\ArcToolbox\Toolboxes\scripts\GenerateStopPairs.py", line 109, in <module>
GTFSErrors = sqlize_csv.handle_agency(gtfs_dir)
File "c:\program files (x86)\arcgis\desktop10.3\ArcToolbox\Toolboxes\sqlize_csv.py", line 426, in handle_agency
handle_file(fname2, label)
File "c:\program files (x86)\arcgis\desktop10.3\ArcToolbox\Toolboxes\sqlize_csv.py", line 387, in handle_file
, rows)
File "c:\program files (x86)\arcgis\desktop10.3\ArcToolbox\Toolboxes\sqlize_csv.py", line 180, in drop_fields
raise BBB_SharedFunctions.CustomError
CustomError

Failed to execute (GenerateTransitLinesAndStops).
Failed at Mon Feb 18 23:25:59 2019 (Elapsed Time: 7.14 seconds)

You can find the GTFS data I used here

Do you think that the data is problematic or there is a bug in the tool?

0 Kudos
MelindaMorang
Esri Regular Contributor

The clue here is in the error message:

GTFS table stops contains at least one row with the wrong number of fields. Fields: [u'stop_id', u'stop_code', u'stop_name', u'stop_desc', u'stop_lat', u'stop_lon', u'zone_id', u'stop_url', u'location_type', u'parent_station', u'stop_timezone', u'wheelchair_boarding']; Row: (u'SpainRenfeLongDistance:71801', u'', u'Barcelona-Sants', u'', u'41.379520', u'2.140624', u'SpainRenfeLongDistance:', u'', u'', u'', u'Europe/Madrid')

I'm guessing you added the wheelchair_boarding field header but didn't add an additional "," to each row in the table.  So, the header row has one more field than the rows after that.  I can see how my previous instructions were unclear on that point.  Each row must have the same length (the length of the header row), so since you added a field to the headers, you need to add a blank space to each of the data rows.  You don't need to add a value for wheelchair_boarding, but there must be a space for it.

0 Kudos