fix the incorrect test
This commit is contained in:
parent
1607bfe225
commit
adf8c481f0
@ -27,9 +27,10 @@ clean:
|
|||||||
|
|
||||||
.PHONY: clean-tables
|
.PHONY: clean-tables
|
||||||
clean-tables:
|
clean-tables:
|
||||||
for t in $$(./db -c '\dt' | awk '/demo|debug|integ/{print $$3}'); do \
|
for t in $$(./db -c '\dt' | awk '/\y(demo_wm|debug_wm|figures)\y/{print $$3}'); do \
|
||||||
./db -c "drop table $$t"; \
|
./db -c "drop table $$t"; \
|
||||||
done
|
done
|
||||||
|
-rm .faux_test
|
||||||
|
|
||||||
.PHONY: slides
|
.PHONY: slides
|
||||||
slides: $(SLIDES)
|
slides: $(SLIDES)
|
||||||
|
33
IV/tests.sql
33
IV/tests.sql
@ -33,35 +33,7 @@ insert into figures (name, way) values ('fig6-combi',
|
|||||||
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)'));
|
||||||
insert into figures (name, way) values ('multi-island',ST_GeomFromText('MULTILINESTRING((-15 10,-10 10,-5 11,0 11,5 11,10 10,11 9,13 10,15 9),(-5 11,-2 15,0 16,2 15,5 11))'));
|
insert into figures (name, way) values ('multi-island',ST_GeomFromText('MULTILINESTRING((-15 10,-10 10,-5 11,0 11,5 11,10 10,11 9,13 10,15 9),(-5 11,-2 15,0 16,2 15,5 11))'));
|
||||||
|
|
||||||
-- DETECT BENDS
|
-- Run ST_SimplifyWM in debug mode
|
||||||
drop table if exists bends;
|
|
||||||
create table bends (name text, ways geometry[]);
|
|
||||||
insert into bends select name, detect_bends(way, name) from figures;
|
|
||||||
|
|
||||||
-- FIX BEND INFLECTIONS
|
|
||||||
drop table if exists inflections, demo_inflections2;
|
|
||||||
create table inflections (name text, ways geometry[]);
|
|
||||||
insert into inflections select name, fix_gentle_inflections(ways) from bends;
|
|
||||||
create table demo_inflections2 (name text, i bigint, way geometry);
|
|
||||||
insert into demo_inflections2 select name, generate_subscripts(ways, 1), unnest(ways) from inflections;
|
|
||||||
|
|
||||||
-- SELF-LINE CROSSING
|
|
||||||
drop table if exists selfcrossing, demo_selfcrossing3;
|
|
||||||
create table selfcrossing (name text, ways geometry[], mutated boolean);
|
|
||||||
insert into selfcrossing select name, (self_crossing(ways)).* from inflections;
|
|
||||||
create table demo_selfcrossing3 (name text, i bigint, way geometry);
|
|
||||||
insert into demo_selfcrossing3 select name, generate_subscripts(ways, 1), unnest(ways) from selfcrossing;
|
|
||||||
|
|
||||||
-- BEND ATTRS
|
|
||||||
do $$
|
|
||||||
declare
|
|
||||||
recs t_bend_attrs[];
|
|
||||||
begin
|
|
||||||
select array(select bend_attrs(ways, name) from inflections) into recs;
|
|
||||||
end
|
|
||||||
$$ language plpgsql;
|
|
||||||
|
|
||||||
-- COMBINED
|
|
||||||
drop table if exists demo_wm;
|
drop table if exists demo_wm;
|
||||||
create table demo_wm (name text, i bigint, way geometry);
|
create table demo_wm (name text, i bigint, way geometry);
|
||||||
insert into demo_wm (name, way) select name, ST_SimplifyWM(way, name) from figures;
|
insert into demo_wm (name, way) select name, ST_SimplifyWM(way, name) from figures;
|
||||||
@ -101,9 +73,6 @@ end $$ language plpgsql;
|
|||||||
|
|
||||||
do $$
|
do $$
|
||||||
declare
|
declare
|
||||||
elem geometry;
|
|
||||||
elems1 geometry[];
|
|
||||||
elems2 geometry[];
|
|
||||||
vcrossings geometry[];
|
vcrossings geometry[];
|
||||||
mutated boolean;
|
mutated boolean;
|
||||||
begin
|
begin
|
||||||
|
@ -15,10 +15,10 @@ declare
|
|||||||
cur_sign int4;
|
cur_sign int4;
|
||||||
l_type text;
|
l_type text;
|
||||||
begin
|
begin
|
||||||
--l_type = st_geometrytype(line);
|
l_type = st_geometrytype(line);
|
||||||
--if l_type != 'ST_LineString' then
|
if l_type != 'ST_LineString' then
|
||||||
-- raise 'This function works with ST_LineString, got %', l_type;
|
raise 'This function works with ST_LineString, got %', l_type;
|
||||||
--end if;
|
end if;
|
||||||
|
|
||||||
-- The last vertex is iterated over twice, because the algorithm uses 3
|
-- The last vertex is iterated over twice, because the algorithm uses 3
|
||||||
-- vertices to calculate the angle between them.
|
-- vertices to calculate the angle between them.
|
||||||
|
Loading…
Reference in New Issue
Block a user