16

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).

4

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.

4

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.

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?

Creating many origin-destination routes with pgRouting (Answer of Otto Coster) If yes then there would be a additional loop neccessary do the calculations for all destinations

  • 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 Feb 1 '15 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 Feb 4 '15 at 21:31
1

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).

I hope it helps

  • 1
    Thanks Ale for your help. @BradHards is right: my question is not precise enough. What I'm looking for is a matrix of road distances. The distance matrix tool you're suggesting 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. – Mathieu Philibert Oct 13 '13 at 14:06
  • 1
    @MathieuPhilibert I am after exactly the same thing. Did you ever find a solution? – MyFamily Jan 31 '15 at 18:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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