29 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
ncelik's user avatar
  • 562
29 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 ...
Joseph's user avatar
  • 75.3k
29 votes

Converting polyline to polygon in QGIS

The "Polygonize" tool from the Processing Toolbox (Ctrl+Alt+T) still works fine for me on simple lines: It is however necessary that the lines intersect, or share common vertices. And lines ...
AndreJ's user avatar
  • 76.5k
19 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('...
Val P's user avatar
  • 3,828
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= ...
Kazuhito's user avatar
  • 30.5k
14 votes

Calculating line with the longest distance inside 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(): ...
BERA's user avatar
  • 68.9k
12 votes

How to create a multipart polygon in QGIS?

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 ...
9Squirrels's user avatar
12 votes

Creating Isochrones in QGIS

Just recently, a new QGIS plugin, called OSM Tools, has been published. This plugin utilizes OpenRouteService API to compute routes and isochrones for various travel modes such as car, heavy vehicle, ...
Runge's user avatar
  • 391
12 votes

Drawing lines from points in QGIS

In QGIS 3 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.
Geographos's user avatar
  • 4,005
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 ...
JGH's user avatar
  • 40.9k
11 votes

Creating Isochrones in QGIS

The plugin QNEAT3 offers a great tool for this creating isochrones or service areas offline based on your own network. You can run Iso-Areas as polygons or another algorithm: To get isochrones, ...
MrXsquared's user avatar
11 votes

Nearest distance between point and line layers in QGIS

In QGIS I can suggest using a "Virtual Layer" through Layer > Add Layer > Add/Edit Virtual Layer.... Let's assume we have two layers 'points' and 'river' with their corresponding ...
Taras's user avatar
  • 31.4k
11 votes

Calculating line with the longest distance inside 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 ...
Gabriel's user avatar
  • 3,117
11 votes

Building the shortest route through all points in QGIS

What you're looking for is called "Travelling salesman problem". Let's assume there are a point layer and a polyline layer, see the image below. There are several approaches available: ...
Taras's user avatar
  • 31.4k
11 votes
Accepted

Generating lines at the end of each measurement with plugin in QGIS

Coming close to what you want, simply using geometry generator, you can use this expression to create the lines from each point to the cursor position where you click: make_line ( $geometry, @...
Babel's user avatar
  • 67.4k
10 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... > ...
Spacedman's user avatar
  • 62.7k
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/...
underdark's user avatar
  • 83.9k
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 ...
JGH's user avatar
  • 40.9k
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" ...
Kadir Şahbaz's user avatar
10 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["...
Kadir Şahbaz's user avatar
10 votes

Creating lines between points with certain attributes using QGIS

Points to path has a 'group' expression optional setting Use this as your unique Id Order expression being the timestamp. Using this, you should get one line for each Id with the Id as an attribute
Kasper's user avatar
  • 3,142
9 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.
Comrade Che's user avatar
  • 7,084
8 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 ...
user30184's user avatar
  • 63.3k
8 votes
Accepted

Finding longest straight line within polygon in QGIS

When holes of the polygons have to be avoided So, this is an extension to my previous answer Calculating the longest distance within polygon in QGIS but with some changes in the Step 3, particularly ...
Taras's user avatar
  • 31.4k
8 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 ...
BERA's user avatar
  • 68.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 ...
JGH's user avatar
  • 40.9k
7 votes

Converting polyline to polygon in QGIS

Just a hint if you can't find the Polygonize tool. In my QGIS 2.18.3 installation (Windows) I could not find the Polygonize tool at Vector geometry tools within the Toolbox. It took me some time to ...
Nicolo's user avatar
  • 330
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, ...
Vadym's user avatar
  • 811
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 ...
John Powell's user avatar
  • 13.6k
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....
user2856's user avatar
  • 64.9k

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