1

I am an environmental engineer and the aim of my QGIS 2.0 project is to visualize the results of a sewage water system inspection. In a first step I included the hoppers from a csv file and added a google streets layer. Now I have to draw the pipes between the hoppers. One way would be to create a vctor layer and draw one pipe after the other. However, I have 522 pipes to draw. So I wonder whether QGIS is able to do it automatically (draw the line of shortest distance between two hoppers?!)

I tried the "nearest neighbour analysis" After this tutorial (http://www.qgistutorials.com/en/docs/nearest_neighbor_analysis.html) it seems to work for different layers. I would like to find the nearest neighbour points inside of my hoppers layer. I also installed the mmqgis plugin in order to make a hub diagram. I loaded a table with start and end hopper number of the different pipes into qgis and tried to link it with the hopper layer. I got this error message:

Traceback (most recent call last): File "C:\Users\stutte/.qgis2/python/plugins\mmqgis\mmqgis_dialogs.py", line 1427, in run message = mmqgis_hub_lines(self.iface, hubname, hubattr, spokename, spokeattr, savename, 1) File "C:\Users\stutte/.qgis2/python/plugins\mmqgis\mmqgis_library.py", line 3377, in mmqgis_hub_lines spokex = spokepoint.geometry().boundingBox().center().x() AttributeError: 'NoneType' object has no attribute 'boundingBox'

Do you have any idea?

project overview: hoppers

0

Points to Paths plugins is experimental and so you have to enable those plugins, in the the settings tab.

PointsToPaths

  • 1
    Thank you very much. The plugin is installed. Now I will adapt the data and try it – user27662 Mar 11 '14 at 9:59
  • 1
    It works!!! I found this description: [link]spatialgalaxy.net/2011/12/30/… and then I just tested it for one street...**Fantastic**. – user27662 Mar 11 '14 at 10:58
0

Firstly you would be wanting to find the shortest distance between points. I think this will be trickiest bit and will depend if you can successfully manipulate the data outside of the GIS system. Then you would just use the points to paths plugin.

Shortest distance between points, you won't get a single answer, rather with the MMQGIS plugin you use the hub function and then for each point would have to sort the values the find the lowest value which will be the corresponding near point. Depends on your other skills.

Then assign a value in an index column to associate those points together.

If that doens't appear obvious, it'll be quicker to do it by hand. Turn on the snapping and turn the tolerance down to nil.

ciao

  • I just installed the mmqgis plugin. Now I am doing the "next neighbour analysis" with my hoppers – user27662 Mar 10 '14 at 12:34
  • I don't understand the hub function of mmqgis. I have the hoppers with the corresponding coordinates. I have data where the sewage water pipes are lying (e.g. CSV) (pipe AB goes from hopper A to hopper B) However I don't know how to link them in the hub tool. I get the following error message: – user27662 Mar 10 '14 at 13:26
  • Traceback (most recent call last): File "C:\Users\stutte/.qgis2/python/plugins\mmqgis\mmqgis_dialogs.py", line 1427, in run message = mmqgis_hub_lines(self.iface, hubname, hubattr, spokename, spokeattr, savename, 1) File "C:\Users\stutte/.qgis2/python/plugins\mmqgis\mmqgis_library.py", line 3377, in mmqgis_hub_lines spokex = spokepoint.geometry().boundingBox().center().x() AttributeError: 'NoneType' object has no attribute 'boundingBox' Could you give me a more detailed explanation? – user27662 Mar 10 '14 at 13:27
  • OK, if you have the data "pipe AB goes from hopper A to B" then this is an index. You can avoid MMQGIS and go straight to the Points to Paths plugin. If the index is indeed AB then you will likely need to amalgamate the values A and B on the target points (hoppers?) so that the same value "AB" is on each of the ends of the new line. Note that the source data may have been directional, i.e. line 1 started at A and ended at B, so really the index needs to be 1A 1B, but you may not be trying to reproduce the directional nature of the line? In GIS lines are directional but points are not. – Willy Mar 11 '14 at 9:29

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.