I have a series of points along a road that I want to use to separate plots. I have tried using the point to line tool to create a line from these points using QGIS. However, it creates a single line with no attributes to separate each segment.
Is there a way to create separate lines for each segment (each straight section would be its own line)?
-
Can you add a screenshot showing the attribute table?Bera– Bera2022年11月24日 18:35:40 +00:00Commented Nov 24, 2022 at 18:35
2 Answers 2
EDIT:
My earlier answer (following this edit) describes the use of the PointsToPaths tool, which has inexplicably been removed from the Plugins repository, after having been updated to 3.x (https://github.com/chiatt/pointstopaths). More's the pity.
Fortunately, however, there is a functionally equivalent alternative:
How to to create lines from points where the point attributes are transferred to the line segments?
Oprionally, if a user absolutely required the PointsToPaths tool, they could download a separate install of the last version of QGIS 2.x (2.18.28), and then install the 2.x version of the PointsToPaths plugin.
End of edit......
Use the QGIS PointsToPaths plugin (note the plural "paths"). It will create a separate line segment for each sequential pair of points. Additionally, each new line segment will contain the attributes from the two points that defined it. For details, see my answer at: Creating line layer from point layer with start and end attributes in QGIS
-
PointsToPaths apparently is not compatible with QGIS 3 and can't be installed in current versions of the app.Kirkman14– Kirkman142024年04月11日 14:35:35 +00:00Commented Apr 11, 2024 at 14:35
-
@Kirkman14 Please see my updated answer.Stu Smith– Stu Smith2024年04月14日 15:26:57 +00:00Commented Apr 14, 2024 at 15:26
Using QGIS, you can use the Split Lines at Points
tool. the tool is located under the Processing toolbox → SAGA → Feature - Lines → Split Lines at Points
.
You need to use a small Epsilon value such as 0.001
to make sure the line will be split at each point
Before using the tool
After using the tool