2

I have an issue using an ArcMap model in batch mode. The purpose of my model is to obtain the result of an OD cost matrix from a selected network and a set of origins and destinations. My goal is to be able to get these results without having to add the data to the display in ArcMap (time and resource consuming), but most of all, I want to be able to automatically process several OD cost matrix one after another. For these reasons, I rebuilt the OD cost matrix routine using ArcMap's Model Builder.

enter image description here

enter image description here

If I test the model on only only network, it works great. However, when I try to batch the process where each time I have a different network with different locations, I have a problem since ArcCatalog seems to mix the different steps. For example, if I batch with only two different networks...

enter image description here

Instead of having:

1. Create OD cost layer (1)
2. Load Origins 1 in network 1
3. Load Destinations 1 in network 1
4. Solve OD cost matrix (1)
5. Create OD cost layer (2)
6. Load Origins 2 in network 2
7. Load Destinations 2 in network 2
8. Solve OD cost matrix (2)

ArcCatalog does this:

1. Create OD cost layer (1)
2. Create OD cost layer (2)
3. Load origins 1 in network 2
4. Load origins 2 in network 2
5. Load destinations 1 in network 2
6. Load destinations 2 in network 2
7. Solve OD cost matrix (1)
8. Solve OD cost matrix (2)

I thought that when batching a model ArcCatalog would do the first task completely before even looking at the second. Why are the steps of my model mixed up?

Thanks for your help!

7
  • Even if ModelBuilder is visually appealing and gives a good overview in small models, I'd probably go for a scripting solution for this. It'll give you better control of all parameters and it will work in batch mode. I realize that there's a learning curve if you haven't done any programming before, but by converting your model to a script will give you a good starting point.
    – Martin
    Commented Jun 16, 2014 at 6:53
  • Didn't want to re-write things that are already working well, this is the reason I turned to Model Builder. I guess it should give me the results I want if it worked correctly. If a script is the only solution, then I can try. Although I am not too bad in C++ or R, I never touched python and would need a beginner's guide to ArcMap-oriented python programming.
    – Damien
    Commented Jun 16, 2014 at 7:04
  • 1
    I have repeatedly had this problem with ModelBuilder scripts running in batch. I agree with @Martin that exporting this to Python would fix the order of operations; the ModelBuilder export to Python does not write "good" Python, but it will perform the same operations.
    – Erica
    Commented Jun 16, 2014 at 11:11
  • 1
    I have had similar problems when trying to batch models. It certainly is a Model Builder problem and has nothing to do with your specific model. Since the problem is not the model itsself, for a beginner it might not be a bad idea to just try and script the "batching" part. You can start an existing model from a python script. Maybe that´s less work then rebuilding a complex model in python.
    – Martin
    Commented Jun 16, 2014 at 13:37
  • 1
    That sounds like a new question, so you should consider posting it like that. Link back here to provide context, if you want.
    – Martin
    Commented Jun 17, 2014 at 5:33

0