Calculate Accessibility Matrix failing on MakeFeatureLayer

4162
16
10-10-2021 06:43 AM
EliBrossell
New Contributor

I'm using the Calculate Accessibility Matrix python tool from version 0.5.1 of the tool box.  I'm running this in ArcGIS Pro 2.8.3.  I get an error that the parameters are not valid to the gp.MakeFeatureLayer_management method.

The python command I ran was:

arcpy.TransitNetworkAnalysisTools.CalculateAccessibilityMatrix("Origin", "Dest_rand", r"E:\Work\GIS_DB\ArcGIS\NetworkAnalyst\MDC_TPO\MDC_6\MDC_6.gdb\Origin_CalculateAccessibilityMatrix", "TransitNetwork_ND", "Public transit time", 50, "Minutes", "Wednesday", "08:00", "Wednesday", "09:00", 1, 1000, 4, None, None, True)

The Origin layer has just one point in it.  The Dest_rand layer has 20 points.  I have successfully run other network analyses on the network dataset like Route and Service Area using the Public transit time mode and this day/time.

I'm attaching the messages from the geoprocessing history.  I thought it might have to do with a space in the name of one of the folders in the path to the output layer.  But I've removed the space and still get the same result.  Any thoughts or tips would be greatly appreciated.

0 Kudos
16 Replies
MelindaMorang
Esri Regular Contributor

Hi Eli. I think you're right that the issue you're having with Prepare Time Lapse Polygons described here is probably the same underlying problem as this issue. I'll try to answer them both here.

My guess is that your machine is having trouble spinning up the parallel processes for some reason. I'm not sure why, but my first question for you is how you're calling this from python. Are you using a standalone python script? The python window in Pro? I suspect this will get us to the heart of the matter.

0 Kudos
EliBrossell
New Contributor

Hi Melinda.  I'm not actually running it on the a command line.  I run the tools by double clicking the tool under catalog>toolboxes>Transit Network Analysis Tools>tool.  Where tool is Prepare Time Lapse Polygons or Create Accessibility Matrix.  I extracted the zipped folder in my ArcGIS project folder, then in the extracted folder I clicked to add the python toolbox to the project toolboxes.  Then I run it from there with the nice geoprocessing dialog with the input fields.  I just thought it would be easier to show you what I ran if I gave you the command since I can right click>copy python command to clipboard.

0 Kudos
MelindaMorang
Esri Regular Contributor

Oh, okay. That's fine. Just means my initial idea of where to look for the problem isn't actually the problem. 🙂

I am not sure what's going on. I cannot reproduce the problem. Here's my next suggestion for getting to the bottom of this:

When you run the tool, if you look at the messages, you'll see one that looks like "Intermediate outputs will be written to [blah]." In there will be a bunch of folders with names using strings of letters and numbers (just auto-generated unique names), and in each of those will be a log file. These are the logs for the individual parallel processes. Please take a look and see if you can find the log files and post the files or their contents. We should be able to get more information about that MakeFeatureLayer failure from that.

It looks like when you ran the tool, it finished one process successfully and then failed on the second one for some reason. That's kind of weird. Anyway, since it failed early in the parallel processing, there should only be a few of those folders and log files to look through to find the right one. I'm guessing no more than 4.

You might need to re-run the tool again to generate some fresh log files. I'm not sure if the old ones from your earlier failed run might have been automatically cleaned up with Pro's garbage collection at some point.

0 Kudos
MelindaMorang
Esri Regular Contributor

By the way, while looking into this issue, I identified and fixed a couple of other, unrelated minor issues. An updated version of the toolbox is available at https://www.arcgis.com/home/item.html?id=23cc1b720eb0418db4d0e61955b8fe43. Among them was fixing the Travel Mode parameter so it auto-populates after you select the network. I had inadvertently messed that up with my most recent update a few weeks ago.

0 Kudos
EliBrossell
New Contributor

I found the log files.  There were 62 folders with one log in each.  I've looked maybe 10 of them.  Of the ones I've looked at tThey all look like this one except for one which had less info in it.

0 Kudos
EliBrossell
New Contributor

Should I look for a version of the tools from before it started using parallel processing?  Is there a way to run the latest code so it does not use parallel processing.  I've tried 1, 2 and leaving default 4 for the max number of parallel processes.

0 Kudos
MelindaMorang
Esri Regular Contributor

Sorry you're having these problems. I was hoping the log files would be more enlightening, but they don't tell us much at all.

If you just want to move along and get your work done, which is completely understandable, you can download the older, ArcMap-compatible version of this toolbox here: https://arcg.is/1u8WKS The tools should work in Pro, and they don't do the multiprocessing thing at all. In fact, they run in a completely different way, so be sure to look at the user's guide to see how to set up your inputs.

If you're willing to keep experimenting and have the time for it, you could add a couple of lines of code to write more info to the log files.

Put these at line 426 of parallel_odcm.py. Be sure to close and reopen Pro (otherwise it won't pick up the changes) before re-running the tool. Then check the log files again. This just prints the input parameters to the logs and might tell us something more.

        self.logger.debug(origins_where_clause)
        self.logger.debug(self.origins)
        self.logger.debug(self.input_origins_layer)

 

0 Kudos
EliBrossell
New Contributor

I just tried adding in the debug lines as shown in the screenshot and it made it so it cant run at all

I also tried adding the lines within the run_gp_tool(arcpy.management.MakeFeatureLayer... parenthesis.  Similarly it didn't run and gave the same 9 error messages.

0 Kudos
EliBrossell
New Contributor

New test that also wouldn't run. I tried to add the workspace parameter to the MakeFeatureLayer calls. Seems like the same reason.  Meaning, the changes I tried didn't introduce another problem and also didn't fix whatever is going on. 

So far this morning I was still using the previous version of the tools.  I've downloaded the zip file again today and I'll begin using it for further testing.

0 Kudos