main
Motiejus Jakštys 2021-05-19 22:57:45 +03:00 committed by Motiejus Jakštys
parent 671a680277
commit 1224fddcec
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);
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

12
wm.sql
View File

@ -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;