Using ArcGIS 10 Network Analyst, I've created small python script that calculates OD matrix between certain locations, i.e. not between each origin and destination but for each origin I have a set of destinations that I want to calculate routes for. I end up with 17 results saved as a .lyr file (don't necessary need to save them on hard drive as such). I would like to merge those results together. The problem is a OD Cost Matrix Layer is in fact a group of layers and I'm only interested in layer Lines.

To sum up: if layer is OD Cost Matrix Layer (group of layers) and Lines is one of the layer in that group and I want to use Merge tool to merge a few of such Lines layers - how do I do it as

arcpy.Merge_management(layer, output)

is obviously giving me an error of input not being a table view.


1 Answer 1


The solution was to merge those layers I need a list of OD layer names with "\Lines" added to them. Something like that

layers = ["ODlayer1\Lines", "ODlayer2\Lines", "ODlayer3\Lines"]
arcpy.Merge_management(layers, output)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.