eliminate small bends and reduce isolation_threshold

too many bends get "isolated". The criteria needs to be updated, for now
just reducing the threshold improves the situation a bit.
This commit is contained in:
Motiejus Jakštys 2021-05-11 09:13:30 +03:00
parent dd9fd60cd0
commit 36380339b9
2 changed files with 18 additions and 11 deletions

View File

@ -68,6 +68,7 @@ end $$ language plpgsql;
delete from wm_visuals where name like 'salvis%'; delete from wm_visuals where name like 'salvis%';
insert into wm_visuals(name, way) values('salvis', ( insert into wm_visuals(name, way) values('salvis', (
with multismall as (
select st_intersection( select st_intersection(
(select st_union(way) from wm_rivers where name in ('Šalčia', 'Visinčia')), (select st_union(way) from wm_rivers where name in ('Šalčia', 'Visinčia')),
wm_bbox( wm_bbox(
@ -77,7 +78,13 @@ insert into wm_visuals(name, way) values('salvis', (
), ),
:scaledwidth :scaledwidth
) )
) ways
) )
-- protecting against very small bends that were cut
-- in the corner of the picture
select st_union(a.geom)
from st_dump((select ways from multismall)) a
where st_length(a.geom) >= 100
)); ));
do $$ do $$
@ -110,7 +117,7 @@ begin
foreach i in array array[16, 64, 256] loop foreach i in array array[16, 64, 256] loop
geom1 = st_simplify((select way from wm_visuals where name='salvis'), i); 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); 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); geom3 = st_simplifywm((select way from wm_visuals where name='salvis'), i, 50, 'salvis-' || i);
insert into wm_visuals(name, way) values insert into wm_visuals(name, way) values
('salvis-douglas-' || i, geom1), ('salvis-douglas-' || i, geom1),
('salvis-douglas-' || i || '-chaikin', st_chaikinsmoothing(geom1, 5)), ('salvis-douglas-' || i || '-chaikin', st_chaikinsmoothing(geom1, 5)),

View File

@ -335,7 +335,7 @@ create function wm_bend_attrs(
dbggen integer default null dbggen integer default null
) returns wm_t_attrs[] as $$ ) returns wm_t_attrs[] as $$
declare declare
isolation_threshold constant real default 0.5; isolation_threshold constant real default 0.3;
attrs wm_t_attrs[]; attrs wm_t_attrs[];
attr wm_t_attrs; attr wm_t_attrs;
bend geometry; bend geometry;