I have 1000 lines and 1 route or road line. I want to automatically my lines adjust to route or road without erasing all data in the attribute table. My expected results, 900 lines will same with the route. I used QGIS 2.18

This is my lines

enter image description here

and this is the route/road line enter image description here

  • Can you upgrade to QGIS 3.0? Snap geometries to layer tool does exactly what you want to. – Kazuhito May 23 '18 at 5:00
  • I will try to upgrade my QGIS. @Kazuhito Is it (Snap geometries to layer) plugin? – Arief May 23 '18 at 5:05
  • You can find it in Processing Toolbox | (QGIS) Vector geometry – Kazuhito May 23 '18 at 5:08
  • I upgrade my QGIS and use Snap geometries to layer, but I get error result. Error Message Message _Feature (508) has invalid geometry. Please fix the geometry or change the Processing setting to the "Ignore invalid input features" option. Execution failed after 0.86 seconds – Arief May 23 '18 at 5:42
  • Oh. Have you been successful in removing geometry errors? – Kazuhito May 23 '18 at 9:54

Hopefully you can fix the geometry error soon. After that, please try Snap geometries to layer which is available in QGIS 3.0.

A small test:

Input: Line 1 (green) and Line 2 (red)

enter image description here

Output: Snapped Line 1 (green dots) and Line 2 (red dots)

enter image description here

There are some corners left unsnapped. If you see such incomplete lines, please repeat using this tool again. I mean, snap using the snapped line.

Final output:

enter image description here

| improve this answer | |
  • Thank you for complete answer, but first I have to clean all errors,,, thank you – Arief May 23 '18 at 13:03
  • @Arief yes, cleaning dataset is the most time consuming part... Good luck. – Kazuhito May 23 '18 at 13:07

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.