diff --git a/IV/tests.sql b/IV/tests.sql index b02c8ab..5fa273a 100644 --- a/IV/tests.sql +++ b/IV/tests.sql @@ -11,9 +11,9 @@ begin end $$ LANGUAGE plpgsql; -- to preview this somewhat conveniently in QGIS: --- stage || '_' || dbgname || ' i:' || coalesce(i,'') || ' j:'|| coalesce(j,'') +-- stage || '_' || dbgname || ' iter:' || iter || ' nbend:'|| nbend drop table if exists debug_wm; -create table debug_wm(stage text, dbgname text, i bigint, j bigint, way geometry, props json); +create table debug_wm(stage text, dbgname text, iter bigint, nbend bigint, way geometry, props json); drop table if exists figures; create table figures (name text, way geometry); diff --git a/IV/wm.sql b/IV/wm.sql index 9a2fb56..5d547b6 100644 --- a/IV/wm.sql +++ b/IV/wm.sql @@ -299,9 +299,10 @@ begin select (res.area*(0.75/res.cmp)) into res.adjsize; end if; if dbgname is not null then - insert into debug_wm (stage, dbgname, i, way, props) values( + insert into debug_wm (stage, dbgname, iter, nbend, way, props) values( 'ebendattrs', dbgname, + 1, i, bend, json_build_object( @@ -345,9 +346,10 @@ begin dbg_stage = 1; while mutated loop if dbgname is not null then - insert into debug_wm (stage, dbgname, i, way) values( + insert into debug_wm (stage, dbgname, iter, nbend, way) values( 'afigures', dbgname, + 1, i, lines[i] ); @@ -356,7 +358,7 @@ begin bends = detect_bends(lines[i]); if dbgname is not null then - insert into debug_wm(stage, dbgname, i, j, way) values( + insert into debug_wm(stage, dbgname, iter, nbend, way) values( 'bbends', dbgname, i, @@ -368,7 +370,7 @@ begin bends = fix_gentle_inflections(bends); if dbgname is not null then - insert into debug_wm(stage, dbgname, i, j, way) values( + insert into debug_wm(stage, dbgname, iter, nbend, way) values( 'cinflections', dbgname, i, @@ -380,7 +382,7 @@ begin select * from self_crossing(bends) into bends, mutated; if dbgname is not null then - insert into debug_wm(stage, dbgname, i, j, way) values( + insert into debug_wm(stage, dbgname, iter, nbend, way) values( 'dcrossings', dbgname, i,