我必须从一个多点线串获得一系列简单的线条。我该怎么办?
答案 0 :(得分:1)
尝试此查询:
SELECT MakeLine(sp,ep)
FROM (
SELECT pointn(wkb_geometry, generate_series(1, npoints(wkb_geometry)-1)) as sp,
pointn(wkb_geometry, generate_series(2, npoints(wkb_geometry) )) as ep
FROM geom_table
) as tmp;
虽然在较大的线串上这不是很有效。