[GIS] How to create an OD road distance matrix in QGIS

cost-pathNetworkqgisrouting

I'm looking for the steps required to produce an origin-destination (OD) cost matrix.

What I'm looking for is a matrix of road distances. The distance matrix tool only produces euclidian distances. The QGIS Roadgraph plugin produces the shortest road distance from one origin to N destinations. What I need is a file containing distances from all origins to the N closest destinations. I have a lot of origins so repeating the analyses with Roadgraph is not an option. Thanks again.

I'm looking for a step-by-step description, starting from scratch (ie, with my 3 shapefiles: origins, destinations, road network).

Best Answer

UPDATE - QGIS3:

Since this seems to be an important topic, I would like to share my answer on a similar question.

If you are using the current version of QGIS (3), you can use the plugin QNEAT3. It offers multiple processing algorithms that produce origin-destination matrices (OD-Matrix) as line layer, table or csv file out of the box. All algorithms rely on the dijkstra() method in the qgis.analysis module, therefore all costs are calculated on the basis of shortest paths and make use of C++ code for faster execution.

You can get more information about the plugin at the qgis plugin repository and at the plugins documentation.

Related Question