From 747cb1f42760f7e74229b2fda0fc51574c36e78a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Sat, 17 Apr 2021 11:24:35 +0300 Subject: [PATCH] tests-integration --- IV/Makefile | 6 +++--- IV/aggregate-rivers.sql | 5 ++++- IV/wm.sql | 1 - 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/IV/Makefile b/IV/Makefile index 73a5c4c..c5a1a0e 100644 --- a/IV/Makefile +++ b/IV/Makefile @@ -1,6 +1,6 @@ SOURCE ?= lithuania-latest.osm.pbf +#WHERE ?= name like '%%' WHERE ?= name='Visinčia' OR name='Šalčia' OR name='Nemunas' OR name='Žeimena' OR name='Lakaja' -#WHERE ?= name='Žeimena' OR name='Lakaja' SLIDES = slides-2021-03-29.pdf NON_ARCHIVABLES = notes.txt referatui.txt slides-2021-03-29.txt @@ -127,8 +127,8 @@ clean-tables: done -rm .faux_test -.faux_filter-rivers: .faux_import-osm Makefile - ./db -v where="$(WHERE)" -f aggregate-rivers.sql +.faux_filter-rivers: aggregate-rivers.sql .faux_import-osm Makefile + ./db -v where="$(WHERE)" -f $< touch $@ .faux_import-osm: $(SOURCE) .faux_db diff --git a/IV/aggregate-rivers.sql b/IV/aggregate-rivers.sql index 77ad483..b9ecbe4 100644 --- a/IV/aggregate-rivers.sql +++ b/IV/aggregate-rivers.sql @@ -24,6 +24,9 @@ begin end $$ language plpgsql; +drop index if exists aggregate_rivers_tmp_id; +drop index if exists aggregate_rivers_tmp_gix; +drop table if exists aggregate_rivers_tmp; create temporary table aggregate_rivers_tmp (osm_id bigint, name text, way geometry); create index aggregate_rivers_tmp_id on aggregate_rivers_tmp(osm_id); create index aggregate_rivers_tmp_gix on aggregate_rivers_tmp using gist(way) include(name); @@ -33,5 +36,5 @@ insert into aggregate_rivers_tmp where waterway in ('river', 'stream', 'canal') and :where; drop table if exists agg_rivers; -create table agg_rivers as (select * from aggregate_rivers()); +create table agg_rivers as (select * from aggregate_rivers() where st_length(way) > 20000); drop table aggregate_rivers_tmp; diff --git a/IV/wm.sql b/IV/wm.sql index f359a45..cdb096d 100644 --- a/IV/wm.sql +++ b/IV/wm.sql @@ -88,7 +88,6 @@ begin if st_npoints(bends[i]) >= 3 then dbgpolygon = st_makepolygon(st_addpoint(bends[i], st_startpoint(bends[i]))); end if; - insert into wm_debug(stage, name, gen, nbend, way) values( 'bbends-polygon', dbgname,