icon

Split Lines By Points

v1.7 — GUI Edition  |  Author: Giulio Fattori  |  GitHub

Overview

Split Lines By Points breaks each line feature at the projected position of nearby points. You can control how "nearby" a point must be (areal buffer), exclude points too close to the line (ring buffer), and filter splits that are too close together or too far apart (linear filter).

Download the example GeoPackage to try the tool immediately: 📦 SplitLines.gpkg

Example package
⚠ Note on pseudo-nodes: due to floating-point rounding, split segments may be very close but not perfectly coincident at their endpoints. Use Snap geometries to layer or Clean geometries if needed.

Interface

The plugin adds a ✂ toolbar button and a menu entry under Vector → Split Lines By Points. Clicking opens the dialog below.

Plugin dialog — idle state

Dialog in idle state — temporary layer selected (default).

Plugin dialog — file output mode

File output mode — temporary layer unchecked; format, name and folder are enabled.

Plugin dialog — running state

Dialog during processing — progress bar and live log active, Cancel button enabled.

Sections

SectionDescription
Input Layers Select the line layer to split and the point layer used as split positions. Dropdowns are populated automatically with compatible layers from the project.
Buffer Controls which points are considered split candidates (areal / ring buffer around each line).
Distance between split points Optional linear filter: skip splits that are too close together or too far apart.
Output Choose file format (GPKG, SHP, GeoJSON) or temporary memory layer, set a custom output name and folder, and optionally apply automatic styling.
Progress & Log Live progress bar and colour-coded log. Processing runs in a background thread — QGIS stays responsive.
💡 Click 📖 Open Help at the top of the dialog to open this page at any time.

Parameters

ParameterTypeDefaultDescription
Line layer required Vector — Line The layer whose features will be split.
Point layer required Vector — Point Points that define where the lines are split.
Max distance from line required Double [map units]1.0 Outer radius of the buffer around each line. Only points within this distance are considered.
Min distance from line optional Double [map units]0.0 Inner radius. Points closer than this value are excluded, creating a ring buffer. Leave at 0 to disable.
Min distance between splits optional Double [map units]0.0 Consecutive split points closer than this value along the line are skipped.
Max distance between splits optional Double [map units]0 (unlimited) Consecutive split points farther than this value are skipped. Set to 0 for no upper limit.
All distances are in the map units of the line layer CRS. If the CRS uses degrees, reproject first or convert distances accordingly.

Output & Style

Output type

OptionDescription
Temporary layer (default) Created in memory — no file written. The layer is lost when QGIS is closed unless explicitly saved. Ideal for quick previews.
File output new Uncheck "Create temporary layer" to enable file output. Choose format, name, and destination folder.

File formats new

FormatExtensionNotes
GeoPackage.gpkgRecommended — single file, supports all field types.
Shapefile.shpWide compatibility; field names truncated to 10 chars.
GeoJSON.geojsonGood for web use; coordinates in WGS84 recommended.

Output name & folder new

Set a custom file name in "Output name" (leave blank to use <layer>_split). The correct extension is added automatically — no need to type it. Use the button to browse for a destination folder; if left blank the project folder is used (or the system temp folder if no project is open).

Attributes

All fields of the original line layer are copied to every output segment. The reserved fid field is excluded automatically to avoid conflicts.

Categorized style by @id

When "Apply categorized style by @id" is checked (default on), the result layer is automatically styled with a distinct colour per feature id, using thick rounded lines.

Result layer styled by @id

Result layer loaded in QGIS with automatic categorized style by @id.

💡 The style uses the QGIS expression @id, so it works on both file-based and memory layers with no extra field required.

Example — Simple buffer

Split lines using points within 20 m of the line (max buffer = 20, min buffer = 0).

Parameters — split 20m

Result — each line is broken at the projected position of every qualifying point:

Result — split 20m

Example — Ring buffer

Split lines using only points between 20 m and 30 m from the line (max buffer = 30, min buffer = 20). Points closer than 20 m are excluded.

Parameters — ring buffer

Result — only the point just beyond 20 m is used as a split:

Result — ring buffer

Example — Linear filter

Split lines with points within 30 m but requiring at least 10 m between consecutive splits (max buffer = 30, min split dist = 10).

Parameters — linear filter

Result — closely spaced candidate points are filtered out:

Result — linear filter

Notes & Tips

Thread safety

Since v1.4 all QGIS objects are accessed exclusively in the main thread. The background worker receives plain Python data (WKT strings + attribute lists) and never touches the QGIS API directly. This eliminates the "object lives in a different thread" warnings seen in earlier versions.

Performance

A QgsSpatialIndex is built on the point layer before processing. Candidate-point lookup is O(log n), giving significant speedup on large datasets.

CRS compatibility

The tool does not reproject. Make sure both layers share the same CRS, otherwise distances will be computed incorrectly.

Pseudo-nodes

Floating-point arithmetic can leave split endpoints very slightly apart. If topological precision matters, post-process with Vector → Geometry Tools → Snap geometries to layer.

Large layers

For very large datasets (100 000+ features) consider splitting processing into tiles or using a projected CRS to keep map-unit distances meaningful.

Changelog

VersionChanges
1.7Multi-format output (GPKG, SHP, GeoJSON); custom output name and save folder; file writing via direct OGR — fixes GPKG fid conflict; default output is temporary layer.
1.6Added 📖 Open Help link in dialog UI; updated help page with GUI screenshots.
1.5Categorized style by @id applied automatically; thick rounded lines; optional checkbox.
1.4Full thread-safety: QGIS objects read in main thread, worker uses WKT only. Eliminates thread warnings.
1.3GUI edition: toolbar + dialog; temporary memory layer option; Qt5/Qt6 compatibility.
1.2Bug fix: UnboundLocalError on lines with no nearby points; spatial index; full attribute preservation.
1.1Initial public release as Processing provider plugin.