From be5a175b6beae9599c81220b2ee76e4a8c9a6736 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Fri, 7 May 2021 21:10:01 +0300 Subject: [PATCH] generate WM visuals --- IV/Makefile | 3 +++ IV/visuals.sql | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/IV/Makefile b/IV/Makefile index 509872e..a609946 100644 --- a/IV/Makefile +++ b/IV/Makefile @@ -58,6 +58,9 @@ mj-msc-full.pdf: mj-msc.pdf version.inc.tex $(ARCHIVABLES) ## Thesis for publish .PHONY: test test: .faux_test ## Unit tests (fast) +.PHONY: visuals +visuals: .faux_visuals # Generate visuals for paper (fast) + .PHONY: test-rivers test-rivers: .faux_test-rivers ## Rivers tests (slow) diff --git a/IV/visuals.sql b/IV/visuals.sql index 722d453..800c366 100644 --- a/IV/visuals.sql +++ b/IV/visuals.sql @@ -85,16 +85,17 @@ declare i integer; geom1 geometry; geom2 geometry; + geom3 geometry; begin foreach i in array array[16, 64, 256] loop geom1 = st_simplify((select way from wm_visuals where name='salvis'), i); geom2 = st_simplifyvw((select way from wm_visuals where name='salvis'), i*i); + geom3 = st_simplifywm((select way from wm_visuals where name='salvis'), i); insert into wm_visuals(name, way) values ('salvis-douglas-' || i, geom1), ('salvis-douglas-' || i || '-chaikin', st_chaikinsmoothing(geom1, 5)), ('salvis-visvalingam-' || i, geom2), - ('salvis-visvalingam-' || i || '-chaikin', st_chaikinsmoothing(geom2, 5)); + ('salvis-visvalingam-' || i || '-chaikin', st_chaikinsmoothing(geom2, 5)), + ('salvis-wm-' || i, geom3); end loop; end $$ language plpgsql; - -insert into wm_demo (name, way) select name, ST_SimplifyWM(way, 75, null, name) from wm_visuals where name='salvis';