From b0d41584811d45b8c883d5c956e9b47ca3c48886 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Thu, 13 May 2021 22:31:35 +0300 Subject: [PATCH] bring back non-debug mode --- IV/Makefile | 10 +++++----- IV/visuals.sql | 7 ++++++- IV/wm.sql | 16 +++++++--------- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/IV/Makefile b/IV/Makefile index 9d46544..8273910 100644 --- a/IV/Makefile +++ b/IV/Makefile @@ -41,7 +41,7 @@ RIVERS = \ salvis-overlaid-douglas-64-chaikin-50k \ salvis-overlaid-visvalingam-64-chaikin-50k \ salvis-wm-75-50k \ - salvis-wm-375-250k + salvis-wm-220-250k ################################# # The thesis, publishable version @@ -198,10 +198,10 @@ salvis-wm-75-50k_2SELECT = wm_visuals where name='salvis-wm-75' salvis-wm-75-50k_1COLOR = orange salvis-wm-75-50k_WIDTHDIV = 2 -salvis-wm-375-250k_1SELECT = wm_visuals where name='salvis' -salvis-wm-375-250k_2SELECT = wm_visuals where name='salvis-wm-375' -salvis-wm-375-250k_1COLOR = orange -salvis-wm-375-250k_WIDTHDIV = 2 +salvis-wm-220-250k_1SELECT = wm_visuals where name='salvis' +salvis-wm-220-250k_2SELECT = wm_visuals where name='salvis-wm-220' +salvis-wm-220-250k_1COLOR = orange +salvis-wm-220-250k_WIDTHDIV = 2 .faux_db: db init.sql rivers.sql bash db start diff --git a/IV/visuals.sql b/IV/visuals.sql index 7a4f584..4713a15 100644 --- a/IV/visuals.sql +++ b/IV/visuals.sql @@ -125,7 +125,12 @@ begin ('salvis-visvalingam-' || i, geom2), ('salvis-visvalingam-' || i || '-chaikin', st_chaikinsmoothing(geom2, 5)); end loop; - foreach i in array array[75, 375] loop + -- 220 doesn't work, because there is an exaggerated bend + -- near Šalčia-Žeimena crossing, and it "exaggerates" to the + -- other river. + -- cross-river crossing detection should be more robust --- and + -- the current problems are described in the paper. + foreach i in array array[75, 220] loop 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); diff --git a/IV/wm.sql b/IV/wm.sql index ae0d7f1..0d95f75 100644 --- a/IV/wm.sql +++ b/IV/wm.sql @@ -585,7 +585,6 @@ begin st_pointn(bends[i], st_npoints(bends[i])-1), 0 ); - if dbgname is not null then insert into wm_debug (stage, name, gen, nbend, way) values( 'gexaggeration', dbgname, dbggen, i, bends[i]); @@ -736,6 +735,7 @@ begin gen = 1; while mutated loop + if dbgname is not null then insert into wm_debug (stage, name, gen, nbend, way) values( 'afigures', dbgname, gen, i, lines[i]); @@ -745,7 +745,6 @@ begin bends = wm_fix_gentle_inflections(bends, dbgname, gen); select * from wm_self_crossing(bends, dbgname, gen) into bends, mutated; - if not mutated then attrs = wm_bend_attrs(bends, dbgname, gen); @@ -765,16 +764,15 @@ 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 notice '[%] 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 '[%] Got % (in %) instead of ST_LineString. ' 'Does the exaggerated bend intersect with the line? ' 'If so, try increasing intersect_patience.', gen, st_geometrytype(lines[i]), dbgname; - raise notice 'exiting lineloop, gen:%', gen; - exit lineloop; + --exit lineloop; end if; gen = gen + 1; continue;