From eda24cb6bc206e860d83443987e5eceaa0199b43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Thu, 13 May 2021 19:02:52 +0300 Subject: [PATCH] fix a few observability bugs --- IV/visuals.sql | 4 +++- IV/wm.sql | 17 ++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/IV/visuals.sql b/IV/visuals.sql index 9818d0b..f841b8f 100644 --- a/IV/visuals.sql +++ b/IV/visuals.sql @@ -66,6 +66,7 @@ begin end $$ language plpgsql; +delete from wm_debug where name like 'salvis%'; delete from wm_visuals where name like 'salvis%'; insert into wm_visuals(name, way) values('salvis', ( with multismall as ( @@ -93,6 +94,7 @@ do $$ declare sclong geometry; declare scshort geometry; begin + delete from wm_debug where name like 'fig6-%' or name like 'selfcrossing-1%'; delete from wm_visuals where name like 'fig6-%' or name like 'selfcrossing-1%'; select way from wm_debug where name='fig6' and stage='bbends' and gen=1 into fig6b1 limit 1 offset 0; @@ -125,7 +127,7 @@ begin end loop; --foreach i in array array[75, 375] loop foreach i in array array[75] loop - geom3 = st_simplifywm((select way from wm_visuals where name='salvis'), i, 50, 'salvis-' || i); + geom3 = st_simplifywm((select way from wm_visuals where name='salvis'), i, 50, 'salvis-wm-' || i); insert into wm_visuals(name, way) values ('salvis-wm-' || i, geom3); end loop; diff --git a/IV/wm.sql b/IV/wm.sql index 96fc197..59c7443 100644 --- a/IV/wm.sql +++ b/IV/wm.sql @@ -359,7 +359,7 @@ begin for i in 1..array_length(attrs, 1) loop if dbgname is not null then insert into wm_debug (stage, name, gen, nbend, way, props) values( - 'ebendattrs', dbgname, dbggen, i, bend, + 'ebendattrs', dbgname, dbggen, i, bends[i], jsonb_build_object( 'adjsize', attrs[i].adjsize, 'baselinelength', attrs[i].baselinelength, @@ -706,6 +706,8 @@ begin for i in 1..array_length(lines, 1) loop mutated = true; gen = 1; + + raise notice 'dbgname: %, gen: %', dbgname, gen; while mutated loop if dbgname is not null then insert into wm_debug (stage, name, gen, nbend, way) values( @@ -736,15 +738,16 @@ begin if st_geometrytype(lines[i]) != 'ST_LineString' then -- For manual debugging: - --insert into wm_manual(name, way) - --select 'non-linestring-' || a.path[1], a.geom - --from st_dump(lines[i]) a - --order by a.path[1]; - raise 'Got % (in %) instead of ST_LineString. ' + insert into wm_manual(name, way) + select 'non-linestring-' || a.path[1], a.geom + from st_dump(lines[i]) a + order by a.path[1]; + raise notice 'Got % (in %) instead of ST_LineString. ' 'Does the exaggerated bend intersect with the line? ' 'If so, try increasing intersect_patience.', st_geometrytype(lines[i]), dbgname; - --exit lineloop; + raise notice 'exiting lineloop, gen:%', gen; + exit lineloop; end if; gen = gen + 1; continue;