prezentacija
This commit is contained in:
parent
3c0f222334
commit
84819fee14
@ -20,6 +20,9 @@ clean-tables:
|
|||||||
./db -c "drop table $$t"; \
|
./db -c "drop table $$t"; \
|
||||||
done
|
done
|
||||||
|
|
||||||
|
slides-2021-03-29.pdf: slides-2021-03-29.txt
|
||||||
|
pandoc -t beamer -i $< -o $@
|
||||||
|
|
||||||
.faux_filter-rivers: .faux_import-osm
|
.faux_filter-rivers: .faux_import-osm
|
||||||
./db -v where="$(WHERE)" -f aggregate-rivers.sql
|
./db -v where="$(WHERE)" -f aggregate-rivers.sql
|
||||||
touch $@
|
touch $@
|
||||||
|
@ -53,8 +53,10 @@ analizė Lietuvos upėms.
|
|||||||
Kitam kartui:
|
Kitam kartui:
|
||||||
- smulkiai surašyti darbo struktūrą ir atsiųsti dėstytojui.
|
- smulkiai surašyti darbo struktūrą ir atsiųsti dėstytojui.
|
||||||
|
|
||||||
Pristatymui reikės akcentuiti:
|
Pristatymui reikės akcentuoti:
|
||||||
- naujumas
|
- naujumas
|
||||||
- aktualumas
|
- aktualumas
|
||||||
- problema
|
- problema
|
||||||
- max 15 skaidrių.
|
- max 15 skaidrių.
|
||||||
|
|
||||||
|
|
||||||
|
57
IV/slides-2021-03-29.txt
Normal file
57
IV/slides-2021-03-29.txt
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
---
|
||||||
|
title: Wang & Müller linijų generalizacijos algoritmo implementacija ir analizė Lietuvos upėms
|
||||||
|
author:
|
||||||
|
- Motiejus Jakštys
|
||||||
|
description: |
|
||||||
|
foo bar
|
||||||
|
|
||||||
|
It consists of two paragraphs
|
||||||
|
date: 2021-03-29
|
||||||
|
lang: lt-LT
|
||||||
|
...
|
||||||
|
|
||||||
|
# Problema
|
||||||
|
|
||||||
|
- Dabartiniai atvirai prieinami algoritmai
|
||||||
|
- Visvalingam-Whyatt
|
||||||
|
- Douglas-Peucker
|
||||||
|
|
||||||
|
- Problemos
|
||||||
|
- nepritaikyti kartografiniams objektams
|
||||||
|
- prarandama geografinė teisybė
|
||||||
|
|
||||||
|
- Alternatyvos
|
||||||
|
- egzistuoja teorinės
|
||||||
|
- nėra implementacijos
|
||||||
|
- neaiškūs parametrai
|
||||||
|
|
||||||
|
# Aktualumas
|
||||||
|
|
||||||
|
- Aprašyti Wang & Müller praktiniais parametrais.
|
||||||
|
- Iš GDR10 sukurti GDR50 ir GDR250 analogus
|
||||||
|
- Palyginti su GDR50 ir GDR250
|
||||||
|
|
||||||
|
# Naujumas
|
||||||
|
|
||||||
|
- Tinkamo algoritmo tiesiog nėra; čia bus vienintelė, nauja implementacija.
|
||||||
|
|
||||||
|
# Progresas
|
||||||
|
|
||||||
|
Užduotis Laikas Statusas
|
||||||
|
------------------------------------------------------------- ------ --------
|
||||||
|
Įlinkių atpažinimas 8 Padaryta
|
||||||
|
Silpnas pasislinkimas įlinkio gale 8 Padaryta
|
||||||
|
Įlinkio kirtimas kitu įlinkiu 8 Padaryta
|
||||||
|
Patikrinimas su Nemunu, Šalčia ir Visinčia 16 Padaryta
|
||||||
|
Matavimai: dydis ir forma 8 Progrese
|
||||||
|
Matavimas: izoliuoti, panaūs 8 -
|
||||||
|
Pašalinimo operatorius 8 -
|
||||||
|
Kombinavimo operatorius 8 -
|
||||||
|
Padinimo operatorius 8 -
|
||||||
|
Pritaikymas visoms Lietuvos upėms 8 -
|
||||||
|
MSc: proza 40 -
|
||||||
|
MSc: apipavidalinimas 4 -
|
||||||
|
|
||||||
|
# Demonstracija
|
||||||
|
|
||||||
|
# Klausimai
|
12
IV/tests.sql
12
IV/tests.sql
@ -10,6 +10,9 @@ begin
|
|||||||
end if;
|
end if;
|
||||||
end $$ LANGUAGE plpgsql;
|
end $$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
drop table if exists debug_wm;
|
||||||
|
create table debug_wm(section text, name text, way geometry);
|
||||||
|
|
||||||
drop table if exists figures;
|
drop table if exists figures;
|
||||||
create table figures (name text, way geometry);
|
create table figures (name text, way geometry);
|
||||||
-- to "normalize" a new line when it's in `f`:
|
-- to "normalize" a new line when it's in `f`:
|
||||||
@ -26,9 +29,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))'));
|
||||||
drop table if exists debug;
|
|
||||||
create table debug (i bigint, way geometry);
|
|
||||||
|
|
||||||
-- DETECT BENDS
|
-- DETECT BENDS
|
||||||
drop table if exists bends, demo_bends1;
|
drop table if exists bends, demo_bends1;
|
||||||
@ -51,9 +52,12 @@ insert into selfcrossing select name, (self_crossing(ways)).* from inflections;
|
|||||||
create table demo_selfcrossing3 (name text, i bigint, way geometry);
|
create table demo_selfcrossing3 (name text, i bigint, way geometry);
|
||||||
insert into demo_selfcrossing3 select name, generate_subscripts(ways, 1), unnest(ways) from selfcrossing;
|
insert into demo_selfcrossing3 select name, generate_subscripts(ways, 1), unnest(ways) from selfcrossing;
|
||||||
|
|
||||||
|
-- BEND ATTRS
|
||||||
|
drop table if exists bendattrs;
|
||||||
|
create table bendattrs (way geometry, area real, cmp real);
|
||||||
|
insert into bendattrs (way, area, cmp) select (bend_attrs(ways, true)).* from inflections;
|
||||||
|
|
||||||
-- COMBINED
|
-- COMBINED
|
||||||
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))'));
|
|
||||||
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, true) from figures where name='multi-island';
|
insert into demo_wm (name, way) select name, ST_SimplifyWM(way, true) from figures where name='multi-island';
|
||||||
|
31
IV/wm.sql
31
IV/wm.sql
@ -266,6 +266,21 @@ begin
|
|||||||
end
|
end
|
||||||
$$ language plpgsql;
|
$$ language plpgsql;
|
||||||
|
|
||||||
|
drop function if exists bend_attrs;
|
||||||
|
create function bend_attrs(bends geometry[], dbg boolean default false) returns table(polygon geometry, area real, cmp real) as $$
|
||||||
|
declare
|
||||||
|
i int4;
|
||||||
|
begin
|
||||||
|
for i in 1..array_length(bends, 1) loop
|
||||||
|
select st_makepolygon(st_addpoint(bends[i], st_startpoint(bends[i]))) into polygon;
|
||||||
|
if dbg then
|
||||||
|
insert into debug_wm (section, name, way) values('bend_attrs', i, polygon);
|
||||||
|
end if;
|
||||||
|
return next;
|
||||||
|
end loop;
|
||||||
|
end;
|
||||||
|
$$ language plpgsql;
|
||||||
|
|
||||||
-- ST_SimplifyWM simplifies a given geometry using Wang & Müller's
|
-- ST_SimplifyWM simplifies a given geometry using Wang & Müller's
|
||||||
-- "Line Generalization Based on Analysis of Shape Characteristics" algorithm,
|
-- "Line Generalization Based on Analysis of Shape Characteristics" algorithm,
|
||||||
-- 1998.
|
-- 1998.
|
||||||
@ -289,10 +304,6 @@ begin
|
|||||||
raise 'Unknown geometry type %', l_type;
|
raise 'Unknown geometry type %', l_type;
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
if dbg then
|
|
||||||
drop table if exists debug_wm;
|
|
||||||
create table debug_wm(name text, way geometry);
|
|
||||||
end if;
|
|
||||||
|
|
||||||
for i in 1..array_length(lines, 1) loop
|
for i in 1..array_length(lines, 1) loop
|
||||||
|
|
||||||
@ -300,7 +311,8 @@ begin
|
|||||||
dbg_stage = 1;
|
dbg_stage = 1;
|
||||||
while mutated loop
|
while mutated loop
|
||||||
if dbg then
|
if dbg then
|
||||||
insert into debug_wm (name, way) values(
|
insert into debug_wm (section, name, way) values(
|
||||||
|
'simplifywm',
|
||||||
dbg_stage || 'afigures_' || i,
|
dbg_stage || 'afigures_' || i,
|
||||||
lines[i]
|
lines[i]
|
||||||
);
|
);
|
||||||
@ -309,7 +321,8 @@ begin
|
|||||||
bends = detect_bends(lines[i]);
|
bends = detect_bends(lines[i]);
|
||||||
|
|
||||||
if dbg then
|
if dbg then
|
||||||
insert into debug_wm(name, way) values(
|
insert into debug_wm(section, name, way) values(
|
||||||
|
'simplifywm',
|
||||||
dbg_stage || 'bbends_' || i || '_' || generate_subscripts(bends, 1),
|
dbg_stage || 'bbends_' || i || '_' || generate_subscripts(bends, 1),
|
||||||
unnest(bends)
|
unnest(bends)
|
||||||
);
|
);
|
||||||
@ -318,7 +331,8 @@ begin
|
|||||||
bends = fix_gentle_inflections(bends);
|
bends = fix_gentle_inflections(bends);
|
||||||
|
|
||||||
if dbg then
|
if dbg then
|
||||||
insert into debug_wm(name, way) values(
|
insert into debug_wm(section, name, way) values(
|
||||||
|
'simplifywm',
|
||||||
dbg_stage || 'cinflections' || i || '_' || generate_subscripts(bends, 1),
|
dbg_stage || 'cinflections' || i || '_' || generate_subscripts(bends, 1),
|
||||||
unnest(bends)
|
unnest(bends)
|
||||||
);
|
);
|
||||||
@ -327,7 +341,8 @@ begin
|
|||||||
select * from self_crossing(bends) into bends, mutated;
|
select * from self_crossing(bends) into bends, mutated;
|
||||||
|
|
||||||
if dbg then
|
if dbg then
|
||||||
insert into debug_wm(name, way) values(
|
insert into debug_wm(section, name, way) values(
|
||||||
|
'simplifywm',
|
||||||
dbg_stage || 'dcrossings' || i || '_' || generate_subscripts(bends, 1),
|
dbg_stage || 'dcrossings' || i || '_' || generate_subscripts(bends, 1),
|
||||||
unnest(bends)
|
unnest(bends)
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user