construct the polygon only if there are enough points
This commit is contained in:
parent
6cefc87b19
commit
5d430d34d1
9
wm.sql
9
wm.sql
@ -111,6 +111,7 @@ create or replace function fix_gentle_inflections(
|
||||
declare
|
||||
len int4;
|
||||
bends1 geometry[];
|
||||
dbgpolygon geometry;
|
||||
begin
|
||||
len = array_length(bends, 1);
|
||||
|
||||
@ -133,12 +134,18 @@ begin
|
||||
i,
|
||||
bends[i]
|
||||
);
|
||||
|
||||
dbgpolygon = null;
|
||||
if st_npoints(bends[i]) >= 3 then
|
||||
dbgpolygon = st_makepolygon(st_addpoint(bends[i], st_startpoint(bends[i])));
|
||||
end if;
|
||||
|
||||
insert into wm_debug(stage, name, gen, nbend, way) values(
|
||||
'cinflections-polygon',
|
||||
dbgname,
|
||||
dbgstagenum,
|
||||
i,
|
||||
st_makepolygon(st_addpoint(bends[i], st_startpoint(bends[i])))
|
||||
dbgpolygon
|
||||
);
|
||||
end loop;
|
||||
end if;
|
||||
|
Loading…
Reference in New Issue
Block a user