3

Does anyone know if it's possible to do a 'one to many' spatial join based on distance in QGIS? The "Join Attributes By Location" under ->Vector->Data Management Tools is very limited...

Just to be clear, below is how it's done in ArcGIS. enter image description here

2
  • 1
    As far as I know, nope, there is no one-to-many option for a spatial join in QGIS. However if you can provide more detail about the data you want to join, there may be workarounds. For instance you could use a Distance Matrix to establish the relationships, the Point Sampling tool, or some buffers and intersects/unions. Commented Jun 4, 2015 at 20:09
  • When you say "below is how it's done in ArcGIS" - what are you referring to? I'd be keen to see this too. Commented Nov 4, 2016 at 9:14

2 Answers 2

2

Have a look at the Hub Distance tool which is part of the MMQGIS plugin documented here: http://michaelminn.com/linux/mmqgis/

The hub distance tool iterates through each feature on the source points layer and finds the closest "hub" from the destination hubs layer based on Ellipsoidal distance. The output is a shapefile containing all the attributes from the source layer along with a distance field and the name of the hub based on an attribute selected in the Hub Layer Name Attribute box.

enter image description here

2

In QGIS, there is the option to concatenate the attributes via virtual layers and SQL. Not really handy but gets the job done. Hopefully someone will implement concatenate functionality in tools such as dissolve or spatial join soon.

2
  • Can you point to a resource for the virtual layers/sql solution? Thank you. @hilpers Commented Jan 9, 2018 at 19:58
  • @eyerah, check out group_concat() in the answer presented here gis.stackexchange.com/questions/212862/… or for a non-SQL approach try using the aggregate() expression from QGIS 3 onwards that supports spatial relations (this is in Italian:) medium.com/@salvatorefiandaca/… Commented Mar 23, 2019 at 1:15

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.