bugfix: two bends that touch cannot be both isolated
This commit is contained in:
parent
7280656051
commit
69353c064a
22
IV/wm.sql
22
IV/wm.sql
@ -371,7 +371,10 @@ begin
|
|||||||
|
|
||||||
-- first and last bends can never be isolated by definition
|
-- first and last bends can never be isolated by definition
|
||||||
if skip_next or i = 1 or i = array_length(attrs, 1) then
|
if skip_next or i = 1 or i = array_length(attrs, 1) then
|
||||||
skip_next = false;
|
-- invariant: two bends that touch cannot be isolated.
|
||||||
|
if st_npoints(bends[i]) > 3 then
|
||||||
|
skip_next = false;
|
||||||
|
end if;
|
||||||
continue;
|
continue;
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
@ -627,8 +630,17 @@ begin
|
|||||||
-- remove last vertex of the previous bend and
|
-- remove last vertex of the previous bend and
|
||||||
-- first vertex of the next bend, because bends always
|
-- first vertex of the next bend, because bends always
|
||||||
-- share a line segment together
|
-- share a line segment together
|
||||||
bends[i-1] = st_removepoint(bends[i-1], st_npoints(bends[i-1])-1);
|
bends[i-1] = st_addpoint(
|
||||||
bends[i+1] = st_removepoint(bends[i+1], 0);
|
st_removepoint(bends[i-1], st_npoints(bends[i-1])-1),
|
||||||
|
st_pointn(bends[i], 1),
|
||||||
|
-1
|
||||||
|
);
|
||||||
|
|
||||||
|
bends[i+1] = st_addpoint(
|
||||||
|
st_removepoint(bends[i+1], 0),
|
||||||
|
st_pointn(bends[i], st_npoints(bends[i])-1),
|
||||||
|
0
|
||||||
|
);
|
||||||
-- the next bend's adjsize is now messed up; it should not be taken
|
-- the next bend's adjsize is now messed up; it should not be taken
|
||||||
-- into consideration for other local minimas. Skip over 2.
|
-- into consideration for other local minimas. Skip over 2.
|
||||||
i = i + 2;
|
i = i + 2;
|
||||||
@ -750,10 +762,10 @@ begin
|
|||||||
select 'non-linestring-' || a.path[1], a.geom
|
select 'non-linestring-' || a.path[1], a.geom
|
||||||
from st_dump(lines[i]) a
|
from st_dump(lines[i]) a
|
||||||
order by a.path[1];
|
order by a.path[1];
|
||||||
raise notice 'Got % (in %) instead of ST_LineString. '
|
raise notice '[%] Got % (in %) instead of ST_LineString. '
|
||||||
'Does the exaggerated bend intersect with the line? '
|
'Does the exaggerated bend intersect with the line? '
|
||||||
'If so, try increasing intersect_patience.',
|
'If so, try increasing intersect_patience.',
|
||||||
st_geometrytype(lines[i]), dbgname;
|
gen, st_geometrytype(lines[i]), dbgname;
|
||||||
raise notice 'exiting lineloop, gen:%', gen;
|
raise notice 'exiting lineloop, gen:%', gen;
|
||||||
exit lineloop;
|
exit lineloop;
|
||||||
end if;
|
end if;
|
||||||
|
Loading…
Reference in New Issue
Block a user