The OD Cost matrix does NOT give direct/aerial distances. It computes the network shortest paths. But, for performance, it does not return back the route geometries of the path taken and simply draws a straight line to indicate the pair for which the network cost is computed. It is designed to return a matrix of distances. If you need to get the route geometries as well then use the Closest Facility solver. It does what OD does but also returns the route shapes. Make sure to set the number of facilities to find to the number you have (destinations) as the default is to find 1.
I could not understand exactly what you mean with your last sentence "Make sure to set the number of facilities to find to the number you have (destinations) as the default is to find 1.:???
He means that by default the tool looks for ONLY one destination (facility) unless you specify explicitly the exact number of destinations. In other words, the tool does a one-to-one and not one-to-many. Usually the "analysis settings" tab has this option. You can set it to "All" if it is not set already.
Thanks a lot! It works! but i have another problem. i have 4000*800 matrix. so the result becomes very big and i cannot export the full result file to excels.Do anyone have any suggestion how to export huge data set into excels from GIS?
Do you know any python? If so, you can solve the OD Cost Matrix and then use a search cursor and a for loop to read the values of the table and write them out to a csv file using python's csv module. But, the file may still be too large to open in Excel (which is a limitation of Excel and not ArcGIS). What do you ultimately want to do with the OD Matrix output?