wm

Wang–Müller line generalization algorithm in PostGIS
Log | Files | Refs | README | LICENSE

commit 1224fddcecf8359ff559cd9f5fcb6e7d698ae1ea (tree)
parent 671a680277b33fa84b64f6a985893f5d084b609b
Author: Motiejus Jakštys <motiejus@jakstys.lt>
Date:   Wed, 19 May 2021 22:57:45 +0300

add fig5

Diffstat:
Mtests.sql | 1+
Mwm.sql | 12++++++++----
2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/tests.sql b/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/wm.sql b/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;