Calculate Accessibility Matrix failing on MakeFeatureLayer

4251
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

Oh, I think this might be my bad. Maybe try this instead:

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

 Maybe the new failures are caused because LOGGER doesn't know how to convert those things to strings and print them.

At this point I'm not sure what else to check besides this. I don't think having your data on a different drive or partition is going to make any difference. 

0 Kudos
MelindaMorang
Esri Regular Contributor

I think, based on the error message, there has to be something wrong with the origins_where_clause. Like somehow, the code has created a where clause that for whatever reason is invalid. I don't know how it would do that, but if we can see what the where clause is, that will help.

0 Kudos
EliBrossell
New Contributor

OK.  Yes those additional lines of code worked to add the where clause to the log files.  The first time I tried it today with those new lines, I had only one origin point in the Origins layer.  Because the where clause tried to get all object IDs >= and <= to 1, I thought I would add a couple more.  It still crashed out.  Logs attached in case it helps.

0 Kudos
MelindaMorang
Esri Regular Contributor

Sigh...I'm so sorry, Eli. I am completely befuddled by this problem. I have absolutely no idea what's going on.

Thank you for testing with more than one origin. The OBJECTID <= 1 AND OBJECTID >= 1 query expression definitely looked odd, so it was a good thought you had to test with more than one origin. Too bad that didn't end up being the issue.

Typically if there were a problem with one of the input parameters, the Make Feature Layer tool would generate a more specific error, like “ERROR 000732 Input Features: Dataset <blah> does not exist or is not supported” or “ERROR 000358: Invalid expression”. Your logs are showing that the tool returns  “ERROR 000816: The tool is not valid”, which doesn't even make sense in this context. I sent a query to the person here at Esri who "owns" the Make Feature Layer tool. Maybe he can shed some light on what circumstances would cause the tool to return this error.

In the meantime, I think your best option is to revert back to using the slower ArcMap version. I'm so sorry!

One last thing to check on your end, if you haven't already: Can you run the Make Feature Layer tool on your origins at all, just normally within an ArcGIS Pro session? Does the tool work at all? If it doesn't, then at least we've found our issue. The best thing to do in that case is probably a) uninstall and reinstall Pro and try again, and if that doesn't help, call Esri Support and ask them why a core tool is not working on your machine.

Actually, for that matter, you could try uninstalling and reinstalling Pro anyway, just in case. Or hang on until Pro 2.9 is released in a week or two and see if that fixes it...?

0 Kudos
EliBrossell
New Contributor

Hi Melinda,  Thanks for all the efforts.  Yes, I was able just now to just run MakeFeatureLayer on the Origins layer with no issues.

I wonder if it could be something I have misconfigured in my Transit Network Dataset.

0 Kudos
MelindaMorang
Esri Regular Contributor

No, that's almost certainly not the problem here. The place where the code is erroring out is before it even touches the network dataset. The code is just trying to select a subset of the origins to use for each chunk as is failing for some inexplicable reason.

0 Kudos
EliBrossell
New Contributor

Downloaded and ran the Calc Accessibility Matrix as is from the 0.5.3 of the toolbox with the same results.  Which I think was to be expected.  But I did see the drop down list of travel modes for my Transit Network Dataset.  At this point I am wondering if I could get a description of a working setup.  As in, I'm wondering if by having my project/map folder on a separate drive/partition could be causing the issue. 

In the output of the errors I see that the way I have my files set up, the python tools, my gdb etc are on one partition that is not the "C" drive.  And some of the python scripts are getting called from C, eg C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\concurrent\futures\_base.py.  This _base.py seems to be where I'm having issues.

Also, the ...AppData\Local\Temp\ArcGISProTemp984\scratch\CalcAccMtx... logs etc are going on the C drive.

My next test was to copy my project folder somewhere on C and the results were the same.

0 Kudos