commit 76dee76b31883f55d4d27702cb3d84473ae9bf58 (tree)
parent 69353c064ad73cd4bdf0af2c00513c5611fb072d
Author: Motiejus Jakštys <motiejus@uber.com>
Date: Thu, 13 May 2021 22:06:27 +0300
check more carefully for intersections
Diffstat:
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/IV/visuals.sql b/IV/visuals.sql
@@ -125,8 +125,7 @@ begin
('salvis-visvalingam-' || i, geom2),
('salvis-visvalingam-' || i || '-chaikin', st_chaikinsmoothing(geom2, 5));
end loop;
- --foreach i in array array[75, 375] loop
- foreach i in array array[75] loop
+ foreach i in array array[75, 375] loop
geom3 = st_simplifywm((select way from wm_visuals where name='salvis'), i, 50, 'salvis-wm-' || i);
insert into wm_visuals(name, way) values
('salvis-wm-' || i, geom3);
diff --git a/IV/wm.sql b/IV/wm.sql
@@ -531,12 +531,20 @@ begin
continue when st_intersects(bend,
st_removepoint(st_removepoint(bends[i-1], n-1), n-2));
end if;
+ if n > 2 then
+ tmpint = st_intersection(bend, st_removepoint(bends[i-1], n-1));
+ continue when st_npoints(tmpint) > 1;
+ end if;
n = st_npoints(bends[i+1]);
if n > 3 then
continue when st_intersects(bend,
st_removepoint(st_removepoint(bends[i+1], 0), 0));
end if;
+ if n > 2 then
+ tmpint = st_intersection(bend, st_removepoint(bends[i+1], 0));
+ continue when st_npoints(tmpint) > 1;
+ end if;
for n in -intersect_patience+1..intersect_patience-1 loop
continue when n in (-1, 0, 1);
@@ -727,7 +735,6 @@ begin
mutated = true;
gen = 1;
- raise notice 'dbgname: %, gen: %', dbgname, gen;
while mutated loop
if dbgname is not null then
insert into wm_debug (stage, name, gen, nbend, way) values(