I'm quite new to QGIS and trying to figure out how to analyze the following problem.

I have three layers:

  1. settlements point layer with 253 entries
  2. waste treatment facilities point layer with 24 entries
  3. roads polyline layer

My problem is to find the distance between each settlement from layer (1) to each treatment facility in layer (2), however it has to be subjected to roads (layer 3), namely instead of getting aerial distance matrix I am looking for to the matrix that describes the actual driving distance.

I'm kindly asking your help with suggestion of how to perform this analysis with QGIS 1.7 (note that I don't know how to use PostGIS layers, if relevant)

  • what plugin can or should I use?
  • Should the polylines be connected to the points in both layers?
  • 2
    i think you need PostGIS and pgRouting extension for it. – simplexio Jan 15 '13 at 12:31
  • Thanks @simplexio for your answer. Anyone else have any ideas? At the same time, I'll try to dive into postGIS. – dof1985 Jan 15 '13 at 13:13

A short description of the working process (GRASS-GIS) as @gmacfalane asked.

  1. I've performed the analysis as descirbed in GRASS-GIS 7.0 svn. Using Linux-Mint 14 as OS. That is since I had difficulties to run the requested functions on windows OS.

  2. I've imported .shp files that were created in Q-GIS to the GRASS. It was easier to me to create data on Q-GIS, but grass has all necessary functionalities for this purpose.

  3. I've used v.build and v.clean to build topology for my network (road shp file)

  4. I've united all nodes (settlements and waste treatment sites) to on shp file. Added a column that distincts each type of node from the others - and fed data in it using the calculator. e.g. new_col = 10000 + id for all settlemnts, 20000 + id for all recycling sites, etc. Than I've assigned that column to be the new id (category column) - v.reclass can be used here.

  5. Use v.net (operation=connect) to connect all nodes to your network. I've used the threshold of approx. 4,500 meters.

  6. Use v.net.allpairs to calculate the distacne between each two pairs of points on your network.

  7. I've exported the data to a csv file using v.db.select and loaded it to Excel. Data forms in one cell for each line, separated with |. If I'm not mistaken - I filtered all source point (from_cat column) to be the settlements, thus haveing a from_cat of between 10000 - 19999.

  8. Than I have received a table that contain the following: from_cat, to_cat, distance/cost

  9. I have separated the data set by source (to_cat) and built a matrix for each treatment type. Than I've formd further analysis to transform it to cost matrix and find the cheapest route from each settlemnt to each type of treatment site.

You can find explainations about the functions (italic) in grass-manual. It is also recommended to search in and sign up to the grass mailing list. It was very helpful.

Hope I could give general direction.



It has been a while and though there are answers about it somewhere in gis Q&A history, I've decided to use my question to share some of my findings regarding QGIS network analysis.

As @simplexio kindly suggested, postGIS with PgRouting is an option, though too complicated for me. I found out that with QGIS 1.8 the GRASS 6.4.2 plugin is quite sufficient to help with network analysis. It is easy to operate (since the plugin uses QGIS GUI, and some commands), the manual is easy to navigate and importing QGIS files or others is quite easy.

I hope to finish my work soon (overcoming some pc-related technical difficulties) and to upload my working process, since as a begginer it was the hardest for me to find a suffcient document or handbook to guide me through the process.

  • Can you describe how this method is working for you? I'm interested in a similar problem... – gregmacfarlane Nov 9 '13 at 20:29
  • 1
    @gmacfarlane - I've added an answer to outline the work process I've done – dof1985 Nov 11 '13 at 18:54

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.