documentation
This commit is contained in:
parent
95baf98c8b
commit
18a601f204
17
IV/wm.sql
17
IV/wm.sql
@ -16,6 +16,23 @@ declare
|
|||||||
begin
|
begin
|
||||||
pi = radians(180);
|
pi = radians(180);
|
||||||
|
|
||||||
|
-- the last vertex is iterated over twice, because the algorithm uses 3 vertices
|
||||||
|
-- to calculate the angle between them.
|
||||||
|
--
|
||||||
|
-- Given 3 vertices p1, p2, p3:
|
||||||
|
--
|
||||||
|
-- p1___ ...
|
||||||
|
-- /
|
||||||
|
-- ..._____/
|
||||||
|
-- p3 p2
|
||||||
|
--
|
||||||
|
-- This loop will use p1 as the head vertex, p2 will be the measured angle,
|
||||||
|
-- and p3 will be trailing. The line that will be added to the bend will
|
||||||
|
-- always be [p3,p2].
|
||||||
|
-- So once the p1 becomes the last vertex, the loop terminates, and the
|
||||||
|
-- [p2,p1] line will not have a chance to be added. So the loop adds the last
|
||||||
|
-- vertex twice, so it has a chance to become p2, and be added to the bend.
|
||||||
|
--
|
||||||
for p in (
|
for p in (
|
||||||
(select (dp).geom from st_dumppoints(line) as dp order by (dp).path[1] asc)
|
(select (dp).geom from st_dumppoints(line) as dp order by (dp).path[1] asc)
|
||||||
union all
|
union all
|
||||||
|
Loading…
Reference in New Issue
Block a user