File: st_addisonode.sql

package info (click to toggle)
postgis 3.3.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 87,748 kB
  • sloc: ansic: 158,671; sql: 91,546; xml: 54,004; cpp: 12,339; sh: 5,187; perl: 5,100; makefile: 3,085; python: 1,205; yacc: 447; lex: 151; javascript: 6
file content (57 lines) | stat: -rw-r--r-- 1,908 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
set client_min_messages to WARNING;
\set VERBOSITY terse

-- Usual city_data input

\i :top_builddir/topology/test/load_topology.sql

-- NULL exceptions
select ST_AddIsoNode(NULL, 0, 'POINT(1 4)');
select ST_AddIsoNode('tt', 0, NULL);
select ST_AddIsoNode('tt', NULL, NULL);
select ST_AddIsoNode(NULL, NULL, NULL);
-- Wrong topology name
select ST_AddIsoNode('wrong_name', 0, 'POINT(1 4)');
select ST_AddIsoNode('', 0, 'POINT(1 4)');
-- Negative idface
select ST_AddIsoNode('city_data', -1, 'POINT(1 4)');
-- Wrong idface
select ST_AddIsoNode('city_data', 5, 'POINT(5 33)'); -- in face 9
select ST_AddIsoNode('city_data', 9, 'POINT(39 18)'); -- in face 5
-- Coincident nodes
select ST_AddIsoNode('city_data', 0, 'POINT(21 22)');
select ST_AddIsoNode('city_data', NULL, 'POINT(21 22)');
select ST_AddIsoNode('city_data', 1, 'POINT(21 22)');
-- Node on edge
select 'node-on-edge', ST_AddIsoNode('city_data', NULL, 'POINT(28 14)');

-- Smart creation ISO Node (without know idface)';

-- in face 5
select 1 as id, ST_AddIsoNode('city_data', NULL, 'POINT(39 18)') as n
  into nn;
insert into nn -- in universe
select '2', ST_AddIsoNode('city_data', NULL, 'POINT(50 18)');
insert into nn -- in face 9
select '3', ST_AddIsoNode('city_data', NULL, 'POINT(5 33)');

-- Explicit face

insert into nn -- in face 5
select '4', ST_AddIsoNode('city_data', 5, 'POINT(42 18)');
insert into nn -- in universe
select '5', ST_AddIsoNode('city_data', 0, 'POINT(50 17)');
insert into nn -- in face 9
select '6', ST_AddIsoNode('city_data', 9, 'POINT(5 32)');

SELECT 'T'||t.id, n.node_id, n.containing_face FROM nn t, city_data.node n
  WHERE t.n = n.node_id ORDER BY t.id;

-- TODO: test for bug #1503
--SELECT 'T5', st_addisonode('city_data', 22, 'POINT(28.5 32.5)');

-- Test for #3234
SELECT '#3234', topology.ST_AddIsoNode('city_data', 0, 'POINT EMPTY'::geometry);

DROP TABLE nn;
select topology.DropTopology('city_data');