<commit_before># Add GTFS to a Network Dataset Troubleshooting Guide

Created by <NAME>, Esri  

Copyright 2018 Esri  
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.  You may obtain a copy of the License at <http://www.apache.org/licenses/LICENSE-2.0>.  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the specific language governing permissions and limitations under the License.


## Common problems
This document describes some common problems encountered by users of *Add GTFS to a Network Dataset*, and how to solve them.

+ Registering / installing the tools
  - [I can't register/install the transit evaluator](#Registration)
+ Creating the network
  - [I tried to run one of the tools in the Add GTFS to a Network Dataset toolbox, but it said it was missing a script reference.](#MissingScript)
  - [I tried to run one of the tools in the Add GTFS to a Network Dataset toolbox, but it failed with a bunch of error messages like "ImportError".](#MessedUpArcpy)
  - [A tool failed with "ExecuteError: ERROR 999999: Error executing function. Failed to execute (CreateFeatureclass)."](#CorruptGDB)
  - [When I'm setting up the evaluators for my transit travel time cost attribute, "TransitEvaluator" doesn't appear in the drop-down list of evaluator types](#DropDown)
  - [When I built my network, I got build errors.](#BuildErrors)
  - [The Get Network EIDs tool failed with a message saying "Error obtaining network EIDs. Exception from HRESULT: 0x80040216".](#HRESULT)
+ Doing analysis / using the network
  - [I got an FDO error when I tried to open my network dataset or add it to the map](#FDO)
  - [During schedule caching, I got an error that said "unable to open database file"](#noDatabase)
  - [During schedule caching, I got an error that said "All EIDs were null in the transit schedule table. Please run Get Network EIDs."](#noEIDs)
  - [My analysis never uses the transit lines. It only uses the streets.](#NoTransitLines)
  - [My Service Areas have ugly spikes around the transit lines](#Exclude)
+ Other
  - [I upgraded ArcMap to a new version, and now Add GTFS to a Network Dataset.tbx and Transit Analysis Tools.tbx are no longer in ArcToolbox](#ArcMapUpgrade)
  - [The Network Identify tool always shows a cost of -1 for TransitLines edges in my network](#NetworkIdentify)

If you haven't found your answer here, search for answers and post questions in our [GeoNet group](https://community.esri.com/community/arcgis-for-public-transit).


## <a name="Registration"></a>I can't register/install the transit evaluator

If you encounter any problems running AddGTFStoaNetworkDataset_Installer.exe, click the "Show Details" button to view messages.  If some messages are cut off, you can right-click in the message window and choose "Copy Details To Clipboard" and paste the full message list into a text editor.  If the messages do not give you sufficient information to resolve the issue, please contact me and send me the full message window text.

AddGTFStoaNetworkDataset_Installer.exe was newly added to Add GTFS to a Network Dataset in version 0.6.  Previous versions used the Install.bat file, and the procedure frequently let to problems that were usually specific to the installer's computer and security settings.  I'm leaving the following tips here from the old Install.bat method in case they are still relevant in some cases, but AddGTFStoaNetworkDataset_Installer.exe should for the most part have eliminated them.
- Don't try to register the transit evaluator on a network drive or on the Desktop.  Make sure the Add GTFS to a Network Dataset files and folders are all on a local drive on your machine, and also don't put it on the Desktop.
- Check your ArcGIS install path.  Open the Install.bat file (right-click it and click Edit).  Make sure the path on your computer to the file called ESRIRegAsm.exe matches what's written in the file.  If it doesn't, modify the file, try running Install.bat again, and see if that makes it work.
- If you get the error message "Registration failed. Could not load file or assembly...Operation is not supported," your computer might have blocked the TransitEvaluator.dll file as a security risk because it came from another computer.  In the EvaluatorFiles folder, right click TransitEvaluator.dll and click Properties.  If there is an Unblock button at the bottom click it, and then try running Install.bat again.  You might also need to unblock all the other .dll files in this folder and its subfolders.
- If you get an error saying "Registration failed. Could not write to disk", you probably need to run the .bat file as an administrator.  Right click on Install.bat and choose "Run as Administrator".  If it fails again and says it can't find the specified path to the .dll file, open the .bat file for editing and change the "%CD%" in the .dll path to the correct path on your machine.


## <a name="MissingScript"></a>I tried to run one of the tools in the Add GTFS to a Network Dataset toolbox, but it said it was missing a script reference.
The *Add GTFS to a Network Dataset* toolbox files (with the .tbx extensions and the red toolbox icon) have associated python script files (with the .py extensions in the scripts folder).  If you move the toolbox files without moving the associated scripts folder with them, then they will no longer be able to find the scripts, and the tools won't work.  Make sure if you want to move the Add GTFS to a Network Dataset files to a new location that you move the entire folder together and don't separate the files.  Additionally, make sure to uninstall the transit evaluator before you move it, and reinstall it in its new location.


## <a name="MessedUpArcpy"></a>I tried to run one of the tools in the Add GTFS to a Network Dataset toolbox, but it failed with a bunch of error messages like "ImportError".
If the tool failed with an ImportError that says something like "Failed to import sqlite3", ArcMap's python installation might be messed up.  This frequently happens when people have installed Anaconda after installing ArcMap.

Please test your python installation using the following steps:

1. Open ArcMap.
2. Open the [python window](http://desktop.arcgis.com/en/arcmap/latest/analyze/executing-tools/what-is-the-python-window-.htm#ESRI_SECTION1_276E292B80D2439DB179ED9B3B6B63E7).
3. In the python window, type "arcpy.GetInstallInfo()" (without the quotation marks), and click Enter.  This should return some information about your ArcMap installation.  If it returns an error, then something is probably wrong with your ArcMap installation and its reference to python.
4.  If the above works, try typing "import sqlite3" (without the quotation marks).  This should succeed and do nothing.

If one of the steps above fails, it's likely that ArcMap's reference to python is messed up.  You can try reinstalling ArcMap, talking to your systems administrator, or calling [Esri Tech Support](http://support.esri.com/).


## <a name="CorruptGDB"></a>A tool failed with "ExecuteError: ERROR 999999: Error executing function. Failed to execute (CreateFeatureclass)."
This failure is usually a symptom that the geodatabase has gotten corrupted somehow.  Delete your geodatabase, create a new one, and try running the tool again.


## <a name="DropDown"></a>When I'm setting up the evaluators for my transit travel time cost attribute, "TransitEvaluator" doesn't appear in the drop-down list of evaluator types<commit_msg>Add note about diagonal transit lines<commit_after># Add GTFS to a Network Dataset Troubleshooting Guide

Created by <NAME>, Esri  

Copyright 2018 Esri  
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.  You may obtain a copy of the License at <http://www.apache.org/licenses/LICENSE-2.0>.  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the specific language governing permissions and limitations under the License.


## Common problems
This document describes some common problems encountered by users of *Add GTFS to a Network Dataset*, and how to solve them.

+ Registering / installing the tools
  - [I can't register/install the transit evaluator](#Registration)
+ Creating the network
  - [I tried to run one of the tools in the Add GTFS to a Network Dataset toolbox, but it said it was missing a script reference.](#MissingScript)
  - [I tried to run one of the tools in the Add GTFS to a Network Dataset toolbox, but it failed with a bunch of error messages like "ImportError".](#MessedUpArcpy)
  - [My TransitLines feature class has diagonal lines everywhere and doesn't look like the actual transit system](#LineShape)
  - [A tool failed with "ExecuteError: ERROR 999999: Error executing function. Failed to execute (CreateFeatureclass)."](#CorruptGDB)
  - [When I'm setting up the evaluators for my transit travel time cost attribute, "TransitEvaluator" doesn't appear in the drop-down list of evaluator types](#DropDown)
  - [When I built my network, I got build errors.](#BuildErrors)
  - [The Get Network EIDs tool failed with a message saying "Error obtaining network EIDs. Exception from HRESULT: 0x80040216".](#HRESULT)
+ Doing analysis / using the network
  - [I got an FDO error when I tried to open my network dataset or add it to the map](#FDO)
  - [During schedule caching, I got an error that said "unable to open database file"](#noDatabase)
  - [During schedule caching, I got an error that said "All EIDs were null in the transit schedule table. Please run Get Network EIDs."](#noEIDs)
  - [My analysis never uses the transit lines. It only uses the streets.](#NoTransitLines)
  - [My Service Areas have ugly spikes around the transit lines](#Exclude)
+ Other
  - [I upgraded ArcMap to a new version, and now Add GTFS to a Network Dataset.tbx and Transit Analysis Tools.tbx are no longer in ArcToolbox](#ArcMapUpgrade)
  - [The Network Identify tool always shows a cost of -1 for TransitLines edges in my network](#NetworkIdentify)

If you haven't found your answer here, search for answers and post questions in our [GeoNet group](https://community.esri.com/community/arcgis-for-public-transit).


## <a name="Registration"></a>I can't register/install the transit evaluator

If you encounter any problems running AddGTFStoaNetworkDataset_Installer.exe, click the "Show Details" button to view messages.  If some messages are cut off, you can right-click in the message window and choose "Copy Details To Clipboard" and paste the full message list into a text editor.  If the messages do not give you sufficient information to resolve the issue, please contact me and send me the full message window text.

AddGTFStoaNetworkDataset_Installer.exe was newly added to Add GTFS to a Network Dataset in version 0.6.  Previous versions used the Install.bat file, and the procedure frequently let to problems that were usually specific to the installer's computer and security settings.  I'm leaving the following tips here from the old Install.bat method in case they are still relevant in some cases, but AddGTFStoaNetworkDataset_Installer.exe should for the most part have eliminated them.
- Don't try to register the transit evaluator on a network drive or on the Desktop.  Make sure the Add GTFS to a Network Dataset files and folders are all on a local drive on your machine, and also don't put it on the Desktop.
- Check your ArcGIS install path.  Open the Install.bat file (right-click it and click Edit).  Make sure the path on your computer to the file called ESRIRegAsm.exe matches what's written in the file.  If it doesn't, modify the file, try running Install.bat again, and see if that makes it work.
- If you get the error message "Registration failed. Could not load file or assembly...Operation is not supported," your computer might have blocked the TransitEvaluator.dll file as a security risk because it came from another computer.  In the EvaluatorFiles folder, right click TransitEvaluator.dll and click Properties.  If there is an Unblock button at the bottom click it, and then try running Install.bat again.  You might also need to unblock all the other .dll files in this folder and its subfolders.
- If you get an error saying "Registration failed. Could not write to disk", you probably need to run the .bat file as an administrator.  Right click on Install.bat and choose "Run as Administrator".  If it fails again and says it can't find the specified path to the .dll file, open the .bat file for editing and change the "%CD%" in the .dll path to the correct path on your machine.


## <a name="MissingScript"></a>I tried to run one of the tools in the Add GTFS to a Network Dataset toolbox, but it said it was missing a script reference.
The *Add GTFS to a Network Dataset* toolbox files (with the .tbx extensions and the red toolbox icon) have associated python script files (with the .py extensions in the scripts folder).  If you move the toolbox files without moving the associated scripts folder with them, then they will no longer be able to find the scripts, and the tools won't work.  Make sure if you want to move the Add GTFS to a Network Dataset files to a new location that you move the entire folder together and don't separate the files.  Additionally, make sure to uninstall the transit evaluator before you move it, and reinstall it in its new location.


## <a name="MessedUpArcpy"></a>I tried to run one of the tools in the Add GTFS to a Network Dataset toolbox, but it failed with a bunch of error messages like "ImportError".
If the tool failed with an ImportError that says something like "Failed to import sqlite3", ArcMap's python installation might be messed up.  This frequently happens when people have installed Anaconda after installing ArcMap.

Please test your python installation using the following steps:

1. Open ArcMap.
2. Open the [python window](http://desktop.arcgis.com/en/arcmap/latest/analyze/executing-tools/what-is-the-python-window-.htm#ESRI_SECTION1_276E292B80D2439DB179ED9B3B6B63E7).
3. In the python window, type "arcpy.GetInstallInfo()" (without the quotation marks), and click Enter.  This should return some information about your ArcMap installation.  If it returns an error, then something is probably wrong with your ArcMap installation and its reference to python.
4.  If the above works, try typing "import sqlite3" (without the quotation marks).  This should succeed and do nothing.

If one of the steps above fails, it's likely that ArcMap's reference to python is messed up.  You can try reinstalling ArcMap, talking to your systems administrator, or calling [Esri Tech Support](http://support.esri.com/).


## <a name="LineShape"></a>My TransitLines feature class has diagonal lines everywhere and doesn't look like the actual transit system
This is correct.  The TransitLines feature class contains straight-line connections between transit stops that are directly connected by transit service.  They are meant to conceptually represent the connection rather than the actual paths taken by transit vehicles.

The Add GTFS to a Network Dataset toolbox produces data designed specifically to be incorporated into a network dataset to be used for transit network analysis.  Because the network dataset will use travel times derived from the GTFS schedules, the geometry of the TransitLines features is actually irrelevant to the analysis.  

If you wish to create a nice-looking visual representation of your transit lines, you should instead use the [Display GTFS in ArcGIS](http://esri.github.io/public-transit-tools/DisplayGTFSinArcGIS.html) toolbox.

## <a name="CorruptGDB"></a>A tool failed with "ExecuteError: ERROR 999999: Error executing function. Failed to execute (CreateFeatureclass)."
This failure is usually a symptom that the geodatabase has gotten corrupted somehow.  Delete your geodatabase, create a new one, and try running the tool again.


## <a name="DropDown"></a>When I'm setting up the evaluators for my transit travel time cost attribute, "TransitEvaluator" doesn't appear in the drop-down list of evaluator types
{'fraction_non_alphanumeric': 0.05603291782645528, 'fraction_numerical': 0.007261285247488806, 'mean_word_length': 4.477958236658933, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3103360', 'n_tokens_mistral': 4325, 'n_tokens_neox': 4070, 'n_words': 2446}