Is there a tool (or plugin) to extend a segment in Qgis (3)?

I would use it to find objects on a map which are visible on photographs taken from known locations but too far away from those locations to simply search on the map by following a rough direction. So if I draw a segment from the viewpoint to a close object (easier to find on the map) which is in the same direction as the far object and extend that segment, I can then navigate the map knowing the far object is somewhere along that line.

  • 1
    not tested in QGIS 3, but azimuth and distance plugin should do the trick (with a large distance)
    – radouxju
    Jul 3, 2019 at 8:33
  • it doesn't work In QGIS3. Jul 3, 2019 at 8:42
  • 1
    Can I suggest you reword the question to see whether anybody has a nicer/quicker/more elegant solution to the problem you are ultimately trying to solve? You are describing two possible methods here, but there may be some that you either haven't thought of or come across before.
    – Phil G
    Jul 3, 2019 at 12:23
  • The tool geometry by expression will create geometry from an expression. You can use the expression builder functions to calculate the angle from the first point to the second point, and draw a long line along that angle.
    – csk
    Jul 3, 2019 at 16:19
  • Thanks csk. It's more complicated than the solution I found but it helped me find it. Jul 3, 2019 at 22:39

1 Answer 1


Without any plug-in:

  1. Create a vector line object
  2. Draw a segment
  3. In the Processing Toolbox, under Vector Geometry, double-click Extend lines and set the extend distance for either end of the segment
  4. Click Run: it creates a new layer with the extended line.

Plug-in to add a button in the toolbar for quick access:

This small plugin I made adds a button which extends the currently selected line vector layer by 10km (using the same function as the previous solution). It doesn't open any popup window and doesn't create a new layer but instead directly edits the currently selected layer and stays in edit mode. I found it to be the quickest solution for my use case. You can download this plugin here: https://nc-shared05.yourownnet.cloud/s/ZSJfkbwLCCHkmDn

Copy it in your QGIS plugin directory (for QGIS 3 in Linux, it's ~/.local/share/QGIS/QGIS3/profiles/default/python/plugins) and restart QGIS if it was running. You should see a red double arrow button in your toolbar.


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.