wm/test-rivers.sql

30 lines
1014 B
MySQL
Raw Normal View History

\set ON_ERROR_STOP on
SET plpgsql.extra_errors TO 'all';
2021-05-19 23:09:05 +03:00
-- This fails with real rivers since this:
-- commit dcf4c02307baeece51470a961a113a8fad68fad5
-- Merge: 44ee741 3638033
-- Author: Motiejus Jakštys <motiejus@uber.com>
-- Date: Tue May 11 20:29:41 2021 +0300
--
-- Merge branch 'gdb10lt'
--
-- This breaks "test-rivers" for Nemunas.
--
2021-05-19 22:57:50 +03:00
-- (adding GDB10LT data). The same rivers from OpenStreetMaps work.
-- There seems to be a bug in wm_exaggeration.
2021-05-19 22:57:48 +03:00
do $$
declare
npoints bigint;
secs bigint;
begin
2021-05-19 22:57:48 +03:00
select * from ST_SimplifyWM_Estimate((select st_union(way) from wm_rivers)) into npoints, secs;
2021-05-19 22:57:48 +03:00
raise notice 'Total points: %', npoints;
2021-05-19 22:57:48 +03:00
raise notice 'Expected duration: %s (+-%s)', ceil(secs), floor(secs*.5);
2021-05-19 22:57:48 +03:00
end $$ language plpgsql;
2021-05-19 22:57:48 +03:00
delete from wm_debug where name in (select distinct name from wm_rivers);
2021-05-19 22:57:48 +03:00
delete from wm_demo where name in (select distinct name from wm_rivers);
2021-05-19 22:57:49 +03:00
insert into wm_demo (name, way) select name, ST_SimplifyWM(way, 75, null, name) from wm_rivers;