I am getting OD cost matrix for distance/time calculation in python using ArcGIS pro but it is calculating for every origin with every destination, I want to do for given pairs of origin and destination.
How to do it?
Have millions of pairs so running one pair after another in loop won't be possible. So, how to run all pairs together and how can we make it credit free?
Every input is highly appreciated.
The point of OD cost matrix is to evaluate multiple origins and destinations, if you want just routes between pairs, I'd use closest facility and populate the input analysis layers from your feature classes of origins and destinations one pair at a time.
https://pro.arcgis.com/en/pro-app/latest/help/analysis/networks/closest-facility-analysis-layer.htm
I suppose you could also populate the OD points of interest that way too, a selection in the inputs might work.
RE doing it without using credits, if you have the Network Analysis extension in ArcGIS Pro, you can take a street network feature class, build your own network for routing, and use that as the network dataset for the network analysis.
See: