I would like to know how a vector layer can takes attributes of a field, of another vector layer which is not overlapping.

For example, there are 2 vector layers, test_1 (2 records A,B) and test_2 (3 records 1,2,3), and i should have as output, the layer test_1 with the same route, but composed/separated by 3 records as test_2, with the additional field ID (1,2,3) moved to the attribute table of test_1.

This geometry process should be as precise as possible.

Can I do this using QGIS geoprocessing tools?

enter image description here [enter image description here2 enter image description here

enter image description here enter image description hereenter image description here

Using "Join Attributes by Nearest" doesn't work because the records continue to begins and ends in the same points of Test_1. I should have Test_1 divided in 3 records, for example at the transects of Test_2; with 1,2,3 in the attribute table. Look at the pic.

enter image description here

I'm thinking to use this flow ("Transect" of Test_2 -> "Split by lines" of Test_1 from transect -> "Join Attributes by Nearest" -> "Group geometries" of Test_1 from ID), but this is not accurate when a meet an intersection of lines because the transects create much confusion.

  • 2
    Did you try 'join attributes by nearest'?
    – MrXsquared
    Commented May 24, 2020 at 18:02

1 Answer 1


You should use the "Join Attributes by Nearest" tool from the processing toolbox. As you can see on the picture you will need two import layers set a maximum nearest neighbor and if needed a maximum distance.

enter image description here

  • Thanks for the reply!! Using only "Join Attributes by Nearest" tool doesn't work because the geometries of test_1 begins and ends in the same points. I'd like to have test_1 divided in 3 parts corresponding to the transects from the test_2 vertexes. Test_1 should have 3 records divided in the transect intersection and having 1,2,3 in the attribute table. I'm thinking to use this flow ("transect" Test_2 -> "split with lines" Test_1 -> "join attributes by nearest" -> "group geometries" from ID Test_1) but this approach is not accurate especially when i meet an intersection of lines. Thank You!
    – Mark
    Commented May 25, 2020 at 20:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.