wm/tests-rivers.sql

30 lines
928 B
MySQL
Raw Normal View History

2021-05-19 22:57:46 +03:00
\i wm.sql
2021-05-19 22:57:48 +03:00
insert into wm_visuals(name, way) values('salcia-visincia',
st_closestpoint(
(select way from wm_rivers where name='Šalčia'),
(select way from wm_rivers where name='Visinčia')
)
);
insert into wm_visuals(name, way) values('nemunas-merkys',
st_closestpoint(
(select way from wm_rivers where name='Nemunas'),
(select way from wm_rivers where name='Merkys')
)
);
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:48 +03:00
insert into wm_demo (name, way) select name, ST_SimplifyWM(way, name) from wm_rivers;