debugging
This commit is contained in:
parent
06314d77c0
commit
14eaa3a7d7
21
tests.sql
21
tests.sql
@ -22,11 +22,11 @@ insert into figures (name, way) values ('fig6-rev',ST_Reverse(ST_Translate((sele
|
|||||||
insert into figures (name, way) values ('inflection-1',ST_GeomFromText('LINESTRING(110 24,114 20,133 20,145 15,145 0,136 5,123 7,114 7,111 2)'));
|
insert into figures (name, way) values ('inflection-1',ST_GeomFromText('LINESTRING(110 24,114 20,133 20,145 15,145 0,136 5,123 7,114 7,111 2)'));
|
||||||
|
|
||||||
-- DETECT BENDS
|
-- DETECT BENDS
|
||||||
drop table if exists bends, demo_bends;
|
drop table if exists bends, demo_bends1;
|
||||||
create table bends (name text, ways geometry[]);
|
create table bends (name text, ways geometry[]);
|
||||||
insert into bends select name, detect_bends(way) from figures;
|
insert into bends select name, detect_bends(way) from figures;
|
||||||
create table demo_bends (name text, i bigint, way geometry);
|
create table demo_bends1 (name text, i bigint, way geometry);
|
||||||
insert into demo_bends select name, generate_subscripts(ways, 1), unnest(ways) from bends;
|
insert into demo_bends1 select name, generate_subscripts(ways, 1), unnest(ways) from bends;
|
||||||
|
|
||||||
do $$
|
do $$
|
||||||
declare
|
declare
|
||||||
@ -44,11 +44,11 @@ begin
|
|||||||
end $$ language plpgsql;
|
end $$ language plpgsql;
|
||||||
|
|
||||||
-- FIX BEND INFLECTIONS
|
-- FIX BEND INFLECTIONS
|
||||||
drop table if exists inflections, demo_inflections;
|
drop table if exists inflections, demo_inflections2;
|
||||||
create table inflections (name text, ways geometry[]);
|
create table inflections (name text, ways geometry[]);
|
||||||
insert into inflections select name, fix_gentle_inflections(ways) from bends;
|
insert into inflections select name, fix_gentle_inflections(ways) from bends;
|
||||||
create table demo_inflections (name text, i bigint, way geometry);
|
create table demo_inflections2 (name text, i bigint, way geometry);
|
||||||
insert into demo_inflections select name, generate_subscripts(ways, 1), unnest(ways) from inflections;
|
insert into demo_inflections2 select name, generate_subscripts(ways, 1), unnest(ways) from inflections;
|
||||||
|
|
||||||
do $$
|
do $$
|
||||||
declare
|
declare
|
||||||
@ -69,9 +69,12 @@ begin
|
|||||||
perform assert_equals('LINESTRING(123 7,114 7,111 2)', st_astext(vinflections[3]));
|
perform assert_equals('LINESTRING(123 7,114 7,111 2)', st_astext(vinflections[3]));
|
||||||
end $$ language plpgsql;
|
end $$ language plpgsql;
|
||||||
|
|
||||||
|
drop table if exists debug;
|
||||||
|
create table debug (i bigint, way geometry);
|
||||||
|
|
||||||
-- SELF-LINE CROSSING
|
-- SELF-LINE CROSSING
|
||||||
drop table if exists selfcrossing, demo_selfcrossing;
|
drop table if exists selfcrossing, demo_selfcrossing3;
|
||||||
create table selfcrossing (name text, ways geometry[]);
|
create table selfcrossing (name text, ways geometry[]);
|
||||||
insert into selfcrossing select name, self_crossing(ways) from inflections;
|
insert into selfcrossing select name, self_crossing(ways) from inflections;
|
||||||
create table demo_selfcrossing (name text, i bigint, way geometry);
|
create table demo_selfcrossing3 (name text, i bigint, way geometry);
|
||||||
insert into demo_selfcrossing select name, generate_subscripts(ways, 1), unnest(ways) from selfcrossing;
|
insert into demo_selfcrossing3 select name, generate_subscripts(ways, 1), unnest(ways) from selfcrossing;
|
||||||
|
4
wm.sql
4
wm.sql
@ -242,11 +242,13 @@ begin
|
|||||||
-- bends[i] = append(bends[i], multi[2][2..n])
|
-- bends[i] = append(bends[i], multi[2][2..n])
|
||||||
-- remove bends from bends[i+1] to bends[j] inclusive.
|
-- remove bends from bends[i+1] to bends[j] inclusive.
|
||||||
|
|
||||||
raise notice 'j: %, i: %', i, j;
|
raise notice 'j: %, i: %', j, i;
|
||||||
raise notice 'bends[i]: %', st_astext(bends[i]);
|
raise notice 'bends[i]: %', st_astext(bends[i]);
|
||||||
raise notice 'bends[j]: %', st_astext(bends[j]);
|
raise notice 'bends[j]: %', st_astext(bends[j]);
|
||||||
raise notice 'a: %, b: %', st_astext(a), st_astext(b);
|
raise notice 'a: %, b: %', st_astext(a), st_astext(b);
|
||||||
raise notice 'multi: %', st_astext(multi);
|
raise notice 'multi: %', st_astext(multi);
|
||||||
|
insert into debug select x.path[1], x.geom from st_dump(multi) x;
|
||||||
|
|
||||||
raise notice '';
|
raise notice '';
|
||||||
prev_length = array_length(bends, 1);
|
prev_length = array_length(bends, 1);
|
||||||
if j < i then
|
if j < i then
|
||||||
|
Loading…
Reference in New Issue
Block a user