QGIS 2.18 ve QGIS 3.4 üzerinde test edilmiştir
Diyelim ki bir çoklu çizgi katmanı var "lines"
.

Ben bir "Sanal Katman" kullanarak önerebilirsiniz Layer > Add Layer > Add/Edit Virtual Layer...
Birkaç durum olabilir:
Durum 1. Çizgiyi eşit segmentlere ayırma, temel olarak kullanıcı tarafından tanımlanan eşit uzunluk.
Aşağıdaki Sorgu ile, sonuca ulaşmak mümkündür. Segment uzunluğunu artırmak / azaltmak için lütfen 1000 AS step_length
girişi ayarlayın -- configurations
.
-- generate series
WITH RECURSIVE generate_sections(id, sec) AS (
SELECT conf.start + 1, conf.start
FROM conf
UNION ALL
SELECT id + conf.step, sec + conf.step_length/conf.length_line
FROM generate_sections, conf
WHERE sec + conf.step_length/conf.length_line <= 1
),
-- configurations
conf AS (
SELECT
0.0 AS start,
1.0 AS step,
1000 AS step_length,
ST_Length(l.geometry) AS length_line
FROM lines AS l
)
-- query
SELECT gs.id AS id,
ROUND(ST_Length(ST_Line_Substring(l.geometry, start + sec, sec + conf.step_length/conf.length_line)),0) AS seg_length,
ST_Line_Substring(l.geometry, start + sec, sec + conf.step_length/conf.length_line) AS geom
FROM generate_sections AS gs, lines AS l, conf
GROUP BY gs.id
Çıktı Sanal Katman aşağıdaki gibi görünecektir

Not: Eğer 'delta' (son kısa segmenti örneğin) dahil edilmemelidir, sonra insertWHERE sec_length >= step_length
içinde-- query
, aşağıya bakınız
-- query
SELECT gs.id AS id,
ROUND(ST_Length(ST_Line_Substring(l.geometry, start + sec, sec + conf.step_length/conf.length_line)),0) AS seg_length,
ST_Line_Substring(l.geometry, start + sec, sec + conf.step_length/conf.length_line) AS geom
FROM generate_sections AS gs, lines AS l, conf
WHERE seg_length >= step_length
GROUP BY gs.id
Durum 2. Çizgiyi belirli sayıda parçaya bölme
Aşağıdaki Sorgu ile, sonuca ulaşmak mümkündür. Segment sayısını artırmak / azaltmak için lütfen 8 AS sections
girişi ayarlayın -- configurations
.
-- generate series
WITH RECURSIVE generate_sections(id, sec) AS (
SELECT conf.start + 1, conf.start
FROM conf
UNION ALL
SELECT id + conf.step, sec + conf.step
FROM generate_sections, conf
WHERE sec + conf.step < conf.sections
),
-- configurations
conf AS (
SELECT
8 AS sections,
0.0 AS start,
1.0 AS step
)
-- query
SELECT gs.id AS id,
ST_Line_Substring(l.geometry, conf.start + sec/conf.sections, sec/conf.sections + step/conf.sections) AS geom,
ROUND(ST_Length(ST_Line_Substring(l.geometry, conf.start + sec/conf.sections, sec/conf.sections + step/conf.sections)),2) AS seg_length
FROM generate_sections AS gs, lines AS l, conf
WHERE start + step < sections
GROUP BY gs.id
Çıktı Sanal Katman aşağıdaki gibi görünecektir
