I am sure this problem can be solved using the output of the QNEAT3 plugin:
SQL Multi-key-join is the magic word you are looking for. To achieve this in QGIS out of the box, you have to take a little detour through virtual layers. Those allow you to use SQL on multiple layers which enables you to perform the more complex join that is necessary to work with the QNEAT3 output. I assume you have the same situation as in this screenshot:
- a source point layer with their associated target keys (
source_layer_with_target_info - top left table)
- a target layer with the corresponding target keys (
target_layer bottom right table)
- a computed M:N OD-Matrix from QNEAT3 (
qneat3_od_matrix table in the middle)
The fourth table on the right is the result you want to get through joining.
In order to perform the join, follow these steps:
- go to the menu
Add Layer >
Add/Edit Virtual Layer...
- Import the
source_layer_with_target_info layer and the
Use the following Query to perform the multi-key-join (change the column names according to the names in your layer) and then add the layer:
source_layer_with_target_info.source_id = qneat3_od_matrix.origin_id
source_layer_with_target_info.target_id = qneat3_od_matrix.destination_id;
Add the layer
It should look like this screenshot:
You might want to save all layers to disk first - I ran into some errors when creating the virtual layer from memory layers.
And there you go - the attribute table of the virtual table should now show only the combinations that have been listed in your source layer.