26 votes
Accepted

Nearest distance between point and line layers in QGIS

As an alternative, you could: Use the Convert Lines to Points tool from: Processing Toolbox > SAGA > Shapes - Points > Convert Lines to Points (Add points over small distances. E.g. add a point ...
user avatar
  • 72.5k
24 votes

Drawing lines from points in QGIS

To create polygons from points, you can also use "Points to path", then "Lines to polygons" tools without need to install any plugin
user avatar
  • 512
24 votes

Creating points in specified distance along line using QGIS?

There is now a plugin called QChainage that does exactly what you want. You specify an interval distance and the plugin creates points along your line at the specified interval.
user avatar
  • 241
18 votes
Accepted

Creating all possible line segments between all points using QGIS

You can achieve your goal using the Field Calculator. Using the Geometry Generator, with Linestring geometry type, use this expression: collect_geometries( array_foreach( aggregate('...
user avatar
  • 3,547
14 votes
Accepted

Creating line segments at point coordinates in QGIS

One possible tool is "Geometry by expression" in the Processing Toolbox > Vector geometry (search in the Processing Toolbox Ctrl+Alt+T). A Geometry expression to create lines (length= ...
user avatar
  • 29.2k
14 votes

Calculating the longest distance within polygon in QGIS

You can use PyQGIS to measure the distances between all vertices of each polygon and find max: import itertools layer = iface.activeLayer() #Click layer in tree for feat in layer.getFeatures(): ...
user avatar
  • 53.9k
12 votes

Creating all possible line segments between all points using QGIS

You can make use of the virtual layers. Go to Layer/ Add layer/ add-edit virtual layer and enter the following query. Feel free to add as many field as you want. The trick is to do a cross-join on the ...
user avatar
  • 35.1k
11 votes
Accepted

Calculating the longest distance within polygon in QGIS

Bear in mind that someone correctly pointed out very soon in comments that I had misread the question. My answer gives the diameter of the minimal circle but this does not always correspond to the ...
user avatar
  • 2,818
10 votes

How to create a multipart polygon?

For anyone coming to this with newer versions of QGIS, the function to do it is now called "Collect Geometries" rather than "Single parts to Multipart" so it's now Vector > Geometry Tools > Collect ...
user avatar
10 votes

Creating points in specified distance along line using QGIS?

In QGIS 3 (at least in QGIS 3.10) there is a processing tool for that purpose: "Points along geometry"
user avatar
  • 443
10 votes

Drawing lines to nearest points in QGIS

This should be possible without any plugin using the default Processing tools, particularly Distance to nearest hub: https://docs.qgis.org/testing/en/docs/user_manual/processing_algs/qgis/...
user avatar
  • 82.4k
10 votes
Accepted

Creating lines between points within distance in QGIS

Using the distance, you could create a "Virtual Layer" that connects nearby points. Go to the menu Layer > Add Layer > Add/Edit Virtual Layer... and enter the following query. Note ...
user avatar
  • 35.1k
10 votes
Accepted

Creating polygons with fixed extent based on point which represents S/W corner using QGIS

In QGIS, use "Geometry by Expression" tool (in a projected CRS). It will also add points information/attributes to polygons. Select "Polygon" as "Output geometry type" ...
user avatar
8 votes

Drawing lines from points in QGIS

In QGIS 3.x instead of the plugin mentioned above, you can find the "Points to path" tool in your Processing Toolbox (Ctrl+Shift+T). Works exactly the same...
user avatar
  • 3,507
8 votes
Accepted

Split polyline by point using 'sf' package in R

If you snap the point to the line then you can split the line and then extract the parts from the resulting collection. Use a really small tolerance, I don't know how small it needs to be... > ...
user avatar
  • 52.9k
8 votes

Creating polygons with fixed extent based on point which represents S/W corner using QGIS

Using a Virtual layer, you can create a polygon of the desired dimension and move it to each location of the point layer. You can then save as the output if you want to persist the data. Go to the ...
user avatar
  • 35.1k
8 votes
Accepted

Drawing rows in field at the same distance from each other

You can use the Create Grid tool for this task. Also the Clip tool can be useful for removing lines outside the polygon boundaries.
user avatar
  • 5,889
7 votes
Accepted

How to convert points to lines?

One approach is to convert this to raster and then extract contours Another is to find the buffer for each point;Dissolve those buffers to get a narrow polygon;Find the center line of each dissolved ...
user avatar
  • 1,222
7 votes
Accepted

Converting polygon to lines without duplicate edges?

If you are not forced to use QGIS, another Open Source GIS software OpenJUMP http://openjump.org/ has a Planer Graph tool that may be exactly what you need. Here you can find the tool. If you need ...
user avatar
  • 53.2k
7 votes

Creating line segments at point coordinates in QGIS

I put an example of solving the same task with a PyQGIS (3.2) standalone application. Below is the Python code: import sys import math from qgis.core import (QgsPointXY, ...
user avatar
  • 791
7 votes
Accepted

Creating lines connecting each possible pair of points in PostGIS

In PostGIS, this can be done quite easily with a Cartesian product or CROSS JOIN in SQL, ie, joining a table on itself and using the 2nd form of ST_MakeLine. So, assuming a table called points with an ...
user avatar
  • 13.3k
7 votes
Accepted

How can I switch line direction from the Linux commandline?

Use the ogr2ogr utility with the ST_REVERSE function in a SQL statement and OGR SQLite dialect: For example: ogr2ogr -dialect SQLITE -sql "select st_reverse(GEOMETRY), * from input" output.shp input....
user avatar
  • 53.4k
7 votes
Accepted

Getting Polyline (Linestring) coordinates from line layer in QGIS

First, add a field (name: geometry, type: string, length: 1000 keep it long). Then use the following script: lyr = iface.activeLayer() with edit(lyr): for f in lyr.getFeatures(): f["...
user avatar
6 votes

Merging lines with slightly different endpoints in QGIS

There is this QGIS plugin which says it does exactly what you want. https://plugins.qgis.org/plugins/joinmultiplelines/ https://github.com/dgoedkoop/joinmultiplelines (However, I was not able to ...
user avatar
  • 161
6 votes

Switching line direction in QGIS

Based on Nathan's post I've created a processing script to reverse the direction of features: #!/usr/bin/env python # -*- coding: utf-8 -*- # define Interface ##QGIS tools (QGIS 2.x)=group ##Reverse ...
user avatar
6 votes

Switching line direction in QGIS

This plugin reverses the line direction too: https://hub.qgis.org/projects/swapvectordirection You have to select a feature, and turn the layer into edit mode before clicking on the plugin icon.
user avatar
  • 75.2k
6 votes

Finding longest straight line within polygon in QGIS

This is also an approximation. It finds the longest line between existing polygon vertices within each polygon. So the more vertices you have the better the results should be (but the executing time ...
user avatar
  • 53.9k

Only top scored, non community-wiki answers of a minimum length are eligible