While using the Network Analyst Closest Facility task in a python script, my solve operation is failing on incidents that have been located on disconnected network segments. I have tried to use:
arcpy.Solve_na(cf_layer, terminate_on_solve_error=False, ignore_invalids=True)
but then the routes feature is never populated with any data at all, even for incidents that do have a solution.
When I run this same operation in ArcMap, solve executes properly with the addition of a warning window displaying the incidents solve was not able to find a solution for.
This brings me to my question:
1. Is there a way in python for solve to complete on all other features that do have a valid solution so I can continue with my analysis? If not, am I able to access the Network Analyst warning window within python so I can filter out incidents I know will fail?
Thanks in advance,
Joe
Solved! Go to Solution.
For anyone else experiencing something similar,
It turns out that by deleting and recreating the network dataset, all of the operations began to function as expected.
did you try 'skip' and 'continue'
Solve_na (in_network_analysis_layer, {ignore_invalids}, {terminate_on_solve_error}, {simplification_tolerance})
Unfortunately, I get the same result using the string version of the parameters.
then you should have had errors or warnings indicating what was wrong... check the help options in more detail ie.
For anyone else experiencing something similar,
It turns out that by deleting and recreating the network dataset, all of the operations began to function as expected.