# Perpendicular lines on line using QGIS

Geographic Information Systems Asked by KartenLappen on December 25, 2020

I am using QGIS. I want to create perpendicular Lines on another Line (River). The Lines should be created on points on the Line and should have a length of 40 Meters. I want to create the red lines in the picture below (for the complete River).

There are many ways to solve your problem and one of them is the next:

Input data: 1) river_line layer 2) interpolated points after 100 m, see figure below

Figure 1

Action 1 - launch the geo tool "Points along geometry" with a point offset of 50 m as shown in the figure below

Figure 2

The result is shown in the figure below

Figure 3

Action 2, 3 - launch the "PointToPath" geo tool see the figure below

Figure 4

then run the geo tool "ExplodeLines" see the figure below

Figure 5

Action 4 run the geo tool "Rotate" see the picture below

Figure 6

Rezult see the picture below

Figure 7

Action 5 start geo tool "Buffer" on "river_line" layer with distance of 40 m see illustration below

Figure 8

Rezult in the figure below

Figure 9

Action 6 Cut perpendicular lines with the buffer

The result is shown in the figure below

Figure 10

See the figure below for the intermediate result.

Figure 11

Further, in order to close the beginning and the end, you need to lengthen the line in both directions, leave only the outermost segments, turn them 90 degrees, cut and add to the result see Figure 11.

Good luck in knowing about geodata processing :-)....

If necessary, ask clarifying questions on the subject of your question, I hope that I can clarify them...

Answered by Cyril Mikhalchenko on December 25, 2020

Edited answer: My first solution (see below) was for visualisation purposes only. But as you mentioned afterwards, you need the actual geometry. So this here is how to do it:

Go to Menu Processing / Toolbox / Create points along input lines to create points on the line in a set distance - as I can see in your screenshot, the points should have a distance of 100 meters along the line, so set the distance to 100. This creates a new pointslayer interpolated points with an attribute angle that you can use to create perpendicular lines.

As you need it as an actual geometry, use Menu Processing / Toolbox / Gemoetry by expression and set the layer interpolated points as input, geometry type as line and introduce the following expression

extend(
make_line(
$geometry, project ($geometry,
40,
),
40,
0
)


This here is the first solution that does not create new geometries, but is good for visualisation purposes:

Add an additional symbol layer to your line and define it as simple marker, selecting the symbol and size as shown in the screenshot:

In this example, I have created a marker on every vertex. If you need a marker in a regular distance along the line, just make the settings accordingly as shown in the second screenshot (the settings in the red box; the arrow shows where to check for the first solution, every vertex):

Answered by babel on December 25, 2020

## Related Questions

### Getting maximum value of a cumulativeCost Image in Earth Engine

0  Asked on April 6, 2021 by steveakopias

### Are there limits on the number of unique polygons created by the QGIS Union tool?

0  Asked on April 6, 2021 by ledbetter

### Alps classified by SOIUSA

2  Asked on April 6, 2021 by bennos

### Get Lat Long coordinates from LiDAR .LAS ‘Selected Point Attributes’

0  Asked on April 6, 2021 by groblox

### QGIS – Least Cost Analysis – Removing waterbodies

0  Asked on April 6, 2021 by davsal

### How to make a multi color map with one shapefile layer in QGIS?

1  Asked on April 6, 2021 by nitzan-matan

### How to fill a field with the ranking of another field for a shapefile attribute table in ArcGIS Pro?

1  Asked on April 6, 2021 by titi

### Saving each feature symbology to a image using PyQGIS

1  Asked on April 6, 2021

### Creating a polygon from all raster values >0 in QGIS?

1  Asked on April 6, 2021

### How should I handle CRS properly after the major change in PROJ library?

1  Asked on April 6, 2021

### QGIS connection to ESRI feature server: Failed to retrieve service capabilities: Error 499: Token Required

1  Asked on April 6, 2021 by shane-rich

### Is there a way to rasterize polygon with hatch pattern with GDAL CLI or in a Python script?

0  Asked on April 6, 2021 by walkingpendulum

### On the calculus of the variable “autocov” from spdep package

0  Asked on April 6, 2021 by user2300

### KML does not open correctly in QGIS

0  Asked on April 6, 2021 by ks2375

### Image disappearing when georeferencing google earth image?

2  Asked on April 6, 2021 by fiona-newman-thacker

### Why does AttributeRenamer cut data type width?

1  Asked on April 6, 2021 by n-varela

### TimeSeries and Export to CSV Google Earth Explorer

0  Asked on April 6, 2021

### Join attributes by location in QGIS 3

0  Asked on April 6, 2021 by senda

### Is a PostGIS raster column more efficient than a geometry column in this scenario?

0  Asked on April 5, 2021 by georgefourm