Esri / public-transit-tools

Tools for working with GTFS public transit data in ArcGIS
Apache License 2.0
172 stars 51 forks source link

Problem step 1 #146

Closed clemlosc closed 4 years ago

clemlosc commented 4 years ago

Hello,

When I'm doing the step 1 : Generate Shapes with Network Analyst, I'm getting this problem : ^ image

I search but I didn't find the problem. Can you help me ?

Thanks

mmorang commented 4 years ago

The tool's python script is attempting to import another module, and it can't find the other module (the script "Step1_MakeShapesFC.py"). When you downloaded the tool, did you move the toolbox to another folder? Or did you accidentally delete some files?

When you download the tool and unzip it, you should see the following inside the GenerateGTFSShapes_0.6.0.0 folder: image

Inside the "scripts" folder, you should have all of the following: image The highlighted one is the one that is missing, according to the error message.

clemlosc commented 4 years ago

Oh it's okay now ! I just let the folder in "Downloads" and it works. Before, I moved it into another one. Thank you.

But I got another error : image

mmorang commented 4 years ago

My tool is calling the Add Locations geoprocessing tool, and Add Locations is producing an error. It seems to be having trouble with some non-ascii character, probably something with an accent mark. It's probably a stop_id from your GTFS stops.txt file, but I can't really tell for sure.

One thing you can try: Open your stops.txt file in Notepad++ or another text editor where you can view and set the file's encoding, and make sure it is set to UTF-8. If it is set to something else, change it to UTF-8, and then try running the tool again. However, I think it is unlikely that this is the problem, since my tool would have failed in a different location.

In general, both my tool and ArcGIS should be able to handle non-ascii characters correctly. But, I noticed that you're using ArcMap 10.3, which is pretty old (released in 2014, scheduled to be retired in December 2020). It's possible that we fixed some bug in the years since it was released. Is it possible for you to update your software to a newer version (10.8 was recently released) or use ArcGIS Pro?

If you can't do that, or it doesn't help, and if you are able to share your data, you can send it to me, and I can try to replicate and resolve the issue.

clemlosc commented 4 years ago

I changed to UTF-8 and it still doesn't work. I work in a French public administration so I must ask to the administrator for ArcGIS Pro update (currently 1.1 so that's why I used ArcMap) But it is not possible to update ArcMap currently.

I can send you the data.

clemlosc commented 4 years ago

Hello, so I am on ArcGIS Pro 2.5 now. Unfortunately, one hour of processing and I still got nothing. And it's only for a small part of what I must do. image

Now, I don't know what to do to get those shapes.txt files...

Thanks to help me.

mmorang commented 4 years ago

Strange. If you can share your data with me, I will do some testing and see if I can figure out where it's getting stuck. Paste a download link in a comment here or e-mail me at mmorang@esri.com.

clemlosc commented 4 years ago

Thank you. Here is the link to download the data.

https://we.tl/t-vnHYjlj5cg

mmorang commented 4 years ago

Hmm. I successfully ran the tool with your data, and it took just under 10 minutes to finish.

One thing I noticed: When I run the tool in ArcGIS Pro, the tool messages say that the data has 829 unique shapes. Your ArcGIS Pro screenshot above says 878 unique shapes, but your ArcMap screenshot has the same 829 that my Pro does. I don't know what would cause this discrepancy, but are you sure you're using the correct dataset and the correct version of the Generate GTFS Shapes tool in Pro? (Maybe you have multiple versions of the tool and accidentally used an older one.)

If that's not the problem, my guess is that there is a problem with your network dataset. For my testing, I used some version of Esri's Streetmap Premium data for Europe. This is high-quality, well-constructed data, so I know it should work well. What network dataset did you use? Did you make it yourself? If the network is not well connected, if it's missing a spatial index, or if the impedance or restriction attributes aren't working right, that could cause the solve to take longer. If you are able to share your network, I could take a look.

Another option is for you to use the "Generate Shapes With ArcGIS Online" version of the tool. The network calculation will be done by Esri's ArcGIS Online services, which has high-quality data. Running the tool that way costs service credits, but it won't cost very much. At the current 0.005 credits per simple route, it would be 4.145 credits for your 829 shapes. The monetary value of a credit depends on your organization's contract, but I think it's usually something like 0.5 US dollars for a credit, so 4.145 is pretty trivial.

clemlosc commented 4 years ago

I tried what you said but it still doesn't work. Here is the link for my network dataset made by my colleagues https://we.tl/t-aCqPxntzr7

Thank you for your help

clemlosc commented 4 years ago

And yes I have 829 shapes

mmorang commented 4 years ago

Something is wrong with this network dataset, but I have been unable to determine the problem. In ArcMap, if I test a simple Service Area or Route analysis, I get error messages saying the inputs have failed to locate on the network. ArcGIS Pro doesn't have this problem, but the Generate Shapes tool is taking forever, just as you saw. I think that points are failing to locate on the network properly for some reason.

These are the things I tried in order to fix the network (all standard network-fixing and network-checking techniques):

So, I don't know what the problem is, but something is definitely wrong with the network.

Here are your options: 1) Fix this network somehow or recreate it with the same data. You could call tech support at Esri France to get help with fixing the network. Note, however, that even if you fix it, some of your transit stops are located outside the extent of the network, so you will not get a good result even if the network is working correctly. image

2) Create your own network dataset using some different data that might be better.

3) Use the ArcGIS Online version of the tool as suggested in my previous comment.

4) Purchase Streetmap Premium data from Esri for your country or region.

mmorang commented 4 years ago

Option 5: Wait a few months (probably June or July?) for ArcGIS Pro 2.6 to be released and use the new Generate Shapes Features From GTFS tool, which will be included in ArcGIS Pro (no download necessary). However, if your network dataset doesn't work well, you will probably encounter the same problem.

clemlosc commented 4 years ago

Thanks. So we will test with ArcGIS Online. I will let know you.

clemlosc commented 4 years ago

Hello, it's me again. I got an error again with ArcGIS Online.

image

I really don't know what to do...

clemlosc commented 4 years ago

It's because the limit is 150 shapes ?

mmorang commented 4 years ago

Ugh, this is so frustrating.

I tried the ArcGIS Online version with the original GTFS you sent me (which I think is not the same as the one shown for your error message above - yours has 1994 unique shapes, but the original one I'm using has only 829). The tool did not fail, although the majority of shapes were generated using straight lines because the number of stops exceeded the ArcGIS Online calculation limit of 150. So, when the limit is exceeded, the tool throws a warning and uses straight lines. It does not fail.

Note that in the ArcGIS Pro version of this tool that will be released with ArcGIS Pro 2.6 in a few months, I use a chunking method that avoids this limit, so even for this data, you will be able to generate actual shapes using ArcGIS Online.

So, your error message is caused by some other problem, but I don't know what it is. The only thing I can think of right now is that maybe your ArcGIS Online account does not have routing analysis privileges. There is a check in my code for that situation, but it relies on matching an error message string from the server in English. If your ArcGIS Online errors are returned in French (I have no idea if ArcGIS Online does that), then my code could be failing to catch that error. But this is just a wild guess and may not be the problem at all.

I think it might be best for you to wait until ArcGIS Pro 2.6 is released, if at all possible. I'm sorry that isn't a very good solution to all your problems, but the new tools work much better than this one and will be fully supported by Technical Support.

If you're in a hurry, you might be able to register for the ArcGIS Pro Beta program to get access to a pre-release version of the software. I think Beta will be released within the next few weeks, but I'm not completely sure.

https://www.esri.com/en-us/early-adopter I'm not sure exactly what the procedure is for registering for this program, but you can talk to your representative at Esri France and show them this GitHub thread as justification, if required.

By the way, the tools in ArcGIS Pro are in the Conversion Tool toolbox, Transit Feed (GTFS) toolset, and they are called Generate Shapes Features From GTFS and Features to GTFS Shapes.

clemlosc commented 4 years ago

Ok, thank you. So we will wait ArcGIS Pro 2.6.

mmorang commented 4 years ago

ArcGIS Pro 2.6 Beta was just released to the Early Adopter Community. If you are in a hurry to get your analysis done, I can help you get access to the Beta version.

clemlosc commented 4 years ago

Yes it would be kind!

mmorang commented 4 years ago

If you could tell me your e-mail address (or send it to me at mmorang@esri.com if you don't want to post it here), I will connect you with the right people.

mmorang commented 4 years ago

I received confirmation by e-mail that this user was able to resolve the problem and complete his workflow using ArcGIS Pro 2.6. Closing this issue.