Batch Solving Many Routes

13475
23
03-14-2012 06:06 AM
ShaharLevenson
New Contributor III
Hello all,

I periodically need to calculate the shortest walking distance for over 1.8 million routes (2 points per route).
With such a large amount of routes I cannot use the desktop ArcGIS - loading that many locations isn't realistic.

What would be the best practice? Creating a python script? Using ArcObjects? Something else?

I have been doing the calculations in smaller pieces (100K, more or less) in version 9.x but now, in version 10, I want to improve the process and do it in one "chunk".

I have access to a strong workstation (20 GB RAM, 24 cores). How can I utilize all the processing potential?

I have no need for hierarchy, restrictions or preserving stop order and all I want is the distance - not the actual routes layer.

Any thoughts?

Thanks,
Shahar.
Tags (2)
23 Replies
NaAn
by
Occasional Contributor
Hi,

You can throw an exception when no solution is found:

try:
    arcpy.Solve_na(layer1)
except (RuntimeError):
    print "No solution is found for " + str(layer1)


Thanks.

Anna
0 Kudos
XiangHe1
New Contributor
Hi,Anna,

Actually, I have the same problem as described in this thread. The difference is that I developed my code in VBA.
I load points into route layer and get the shortest path in a loop. When the route is not possible, the program just stopped and error messages jump out. How can I skip this problematic route and make the program run into the next iteration? Thank you a lot.

Hi,

You can throw an exception when no solution is found:

try:
    arcpy.Solve_na(layer1)
except (RuntimeError):
    print "No solution is found for " + str(layer1)


Thanks.

Anna
0 Kudos
NaAn
by
Occasional Contributor
Hi Xiang,

You may use this line to continue the loop in VBA:

On Error Resume Next

Thanks.

Anna
0 Kudos
PhilHurvitz
New Contributor

I'm hoping someone could modify the code so this could be used as a stand-alone script. Currently it relies on a route layer being in an ArcMap session. I'd appreciate any advice. Thanks in advance.

0 Kudos