wm

Wang–Müller line generalization algorithm in PostGIS
Log | Files | Refs | README | LICENSE

test-rivers.sql (1014B) - Raw


      1 \set ON_ERROR_STOP on
      2 SET plpgsql.extra_errors TO 'all';
      3 
      4 -- This fails with real rivers since this:
      5 -- commit dcf4c02307baeece51470a961a113a8fad68fad5
      6 -- Merge: 44ee741 3638033
      7 -- Author: Motiejus Jakštys <motiejus@uber.com>
      8 -- Date:   Tue May 11 20:29:41 2021 +0300
      9 -- 
     10 --     Merge branch 'gdb10lt'
     11 --     
     12 --     This breaks "test-rivers" for Nemunas.
     13 --
     14 -- (adding GDB10LT data). The same rivers from OpenStreetMaps work.
     15 -- There seems to be a bug in wm_exaggeration.
     16 
     17 do $$
     18 declare
     19   npoints bigint;
     20   secs bigint;
     21 begin
     22   select * from ST_SimplifyWM_Estimate((select st_union(way) from wm_rivers)) into npoints, secs;
     23   raise notice 'Total points: %', npoints;
     24   raise notice 'Expected duration: %s (+-%s)', ceil(secs), floor(secs*.5);
     25 end $$ language plpgsql;
     26 
     27 delete from wm_debug where name in (select distinct name from wm_rivers);
     28 delete from wm_demo where name in (select distinct name from wm_rivers);
     29 insert into wm_demo (name, way) select name, ST_SimplifyWM(way, 75, null, name) from wm_rivers;