2

I have a road network (red) passing through some traffic data points (green): enter image description here

I want to expand this network to include all of the points. I already have a bigger street network (blue) from which I can take the missing streets.

enter image description here

I am using QGIS.

It would be great if the traffic data of the points could be associated to the street passing through it.

1

If your traffic points are intersecting the road network, you can use the Join attributes by location tool from the toolbar:

Vector > Data Management Tools > Join attributes by location...

I use the following options to make sure I get all the attributes from both layers and delete the ones I no longer need. This should provide you with a point layer which contains the original traffic attributes and the attributes of the road network (i.e. which street the point is on).

Join attributes by location interface

  • Thanks for your reply. So I discovered that when I zoom on the layer, most of the points don't actually intersect the street network. So I created a 10m buffer around the steet network (the final aim is to keep only the streets that intersect the traffic points). This should be fine as now I see that the street network intersect most of the points. – FraTanti Apr 1 '16 at 17:55
  • However, when I try to use the Join attributes by location tool with "Keep all records", it creates a new street network exactly the same as the one I had before (it keeps even the streets that don't instersect a traffic point). If I don't choose this option, I get an empty layer. The two layers are in different projections (that's the only way I managed to have them in the same position on the map). – FraTanti Apr 1 '16 at 18:05
  • @FraTanti - The tool (like most tools) will only really work if both layers are in the same CRS. Did you use the Save As... option on the layers and save them in the same CRS? I find it quite strange why two related layers should be in different projections...=) – Joseph Apr 4 '16 at 8:42
  • OK, I managed to project them in the same CRS and it worked. In Attribute Summary I select: Take summary of the intersecting figures --> Sum However, it only calculated the sum of some of the columns (not the ones I needed). Is there a way to decide of which columns perform the sum? – FraTanti Apr 5 '16 at 12:16
  • @FraTanti - Not with this tool but I think you can with the Spatial Join tool from the MMQGIS plugin, you may need to install/enable this from the toolbar: Plugins > Manage and Install Plugins.... The plugin should be shown as a separate menu in the toolbar (MMQGIS > Combine > Spatial Join) and allows you to choose which fields you want to keep in the output. – Joseph Apr 6 '16 at 9:14

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.