This commit is contained in:
Motiejus Jakštys 2021-02-18 07:59:24 +02:00
parent 54703cb122
commit 8aa51d9304
2 changed files with 9 additions and 4 deletions

View File

@ -15,6 +15,7 @@ drop table if exists figures;
create table figures (name text, way geometry); 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', 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 ('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 $$ do $$
begin begin

View File

@ -1,11 +1,8 @@
\set ON_ERROR_STOP on \set ON_ERROR_STOP on
SET plpgsql.extra_errors TO 'all'; 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 $$ 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 declare
pi real; pi real;
p geometry; p geometry;
@ -45,3 +42,10 @@ begin
end if; end if;
end end
$$ language plpgsql; $$ 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;