less parentheses

main
Motiejus Jakštys 2021-05-19 22:57:47 +03:00 committed by Motiejus Jakštys
parent 0b349d8681
commit a2f2d62033
1 changed files with 7 additions and 7 deletions

14
wm.sql
View File

@ -36,11 +36,11 @@ begin
-- So once the p1 becomes the last vertex, the loop terminates, and the -- 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 -- [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. -- vertex twice, so it has a chance to become p2, and be added to the bend.
for p in ( for p in
(select geom from st_dumppoints(line) order by path[1] asc) (select geom from st_dumppoints(line) order by path[1] asc)
union all union all
(select geom from st_dumppoints(line) order by path[1] desc limit 1) (select geom from st_dumppoints(line) order by path[1] desc limit 1)
) loop loop
p3 = p2; p3 = p2;
p2 = p1; p2 = p1;
p1 = p; p1 = p;
@ -250,7 +250,7 @@ declare
p3 geometry; p3 geometry;
begin begin
angle = 0; angle = 0;
for p0 in (select geom from st_dumppoints(bend) order by path[1] asc) loop for p0 in select geom from st_dumppoints(bend) order by path[1] asc loop
p3 = p2; p3 = p2;
p2 = p1; p2 = p1;
p1 = p0; p1 = p0;
@ -330,7 +330,7 @@ $$ language plpgsql;
create function isolated_bends(INOUT bendattrs t_bend_attrs[], dbgname text default null) as $$ create function isolated_bends(INOUT bendattrs t_bend_attrs[], dbgname text default null) as $$
declare declare
isolation_threshold constant real default 0.33; -- if neighbor's curvatures are within, it's isolated isolation_threshold constant real default 0.25; -- if neighbor's curvatures are within, it's isolated
this real; this real;
skip_next bool; skip_next bool;
res t_bend_attrs; res t_bend_attrs;