diff --git a/IV/tests.sql b/IV/tests.sql index fe09dbd..36bee92 100644 --- a/IV/tests.sql +++ b/IV/tests.sql @@ -15,6 +15,7 @@ drop table if exists figures; create table figures (name text, way geometry); insert into figures (name, way) values ('fig3', ST_GeomFromText('LINESTRING(0 0, 12 0, 13 4, 20 2, 20 0, 32 0, 33 10, 38 16, 43 15, 44 10, 44 0, 60 0)')); insert into figures (name, way) values ('fig3-1', ST_GeomFromText('LINESTRING(0 0, 12 0, 13 4, 20 2, 20 0, 32 0, 33 10, 38 16, 43 15, 44 10, 44 0)')); +insert into figures (name, way) values ('fig5', ST_GeomFromText('LINESTRING(0 39,19 52,27 77,26 104,41 115,49 115,65 103,65 75,53 45,63 15,91 0,91 0)')); do $$ begin diff --git a/IV/wm.sql b/IV/wm.sql index ba1612e..5cd9bf8 100644 --- a/IV/wm.sql +++ b/IV/wm.sql @@ -1,11 +1,8 @@ \set ON_ERROR_STOP on SET plpgsql.extra_errors TO 'all'; +-- detect_bends detects bends using the inflection angles. It does not do corrections. create or replace function detect_bends(line geometry) returns table(bend geometry) as $$ -/* for each bend, should return: - - size (area) - - shape (cmp, compactness index) -*/ declare pi real; p geometry; @@ -45,3 +42,10 @@ begin end if; end $$ language plpgsql; + + +-- fix_gentle_inflections moves bend endpoints in case of gentle inflections +create or replace function fix_gentle_inflections(line geometry) returns table(bend geometry) as $$ +begin +end +$$ language plpgsql;