18

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.

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

3
  • I guess pgRouting would be the best option for you. Could you please have a look at these post and say if this is in general what you are looking for? gis.stackexchange.com/questions/40542/… (Answer of Otto Coster) If yes then there would be a additional loop neccessary do the calculations for all destinations
    – Thomas B
    Commented Feb 1, 2015 at 10:53
  • that's a useful start and seems very similar to what I am after. The only issues is I don't have access to PostGIS and was wondering if there are any QGIS plugins that would perform the same analysis
    – MyFamily
    Commented Feb 1, 2015 at 11:02
  • QGIS itself does not generate a network topology for calculating road distances out of the box. therefore you need something like pgRouting or perhaps GRASS-Modules as an alternative. you could have a look at jcastellssala.wordpress.com/2012/05/07/… grass.osgeo.org/grass70/manuals/v.net.allpairs.html
    – Thomas B
    Commented Feb 4, 2015 at 21:31

3 Answers 3

6

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.

5

QGIS has all the algorithms necessary, but there is no GUI to create matrices yet. With some Python knowledge the Network Analysis library documentation should get you started.

0

In QGIS there is the Distance Matrix tool from the top bar: vector/analysis tools/distance matrix tool (I hope the translation is right because of my territorial version).

0

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.