Skip to content

Commit d108fed

Browse files
committed
[makeBiconnectedPlanar/docqueries] Adding test documentation examples code for pgr_makeBiconnectedPlanar
1 parent 46ef96a commit d108fed

4 files changed

Lines changed: 73 additions & 0 deletions

File tree

docqueries/planar/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
set(LOCAL_FILES
66
boyerMyrvold
77
isPlanar
8+
makeBiconnectedPlanar
89
)
910

1011
foreach (f ${LOCAL_FILES})
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/* :file: This file is part of the pgRouting project.
2+
:copyright: Copyright (c) 2020-2026 pgRouting developers
3+
:license: Creative Commons Attribution-Share Alike 3.0 https://creativecommons.org/licenses/by-sa/3.0 */
4+
/* -- q1 */
5+
SELECT * FROM pgr_makeBiconnectedPlanar(
6+
'SELECT id, source, target, cost, reverse_cost FROM edges'
7+
);
8+
/* -- q2 */
9+
CREATE TABLE example_edges_bi (
10+
id SERIAL PRIMARY KEY,
11+
source INTEGER,
12+
target INTEGER,
13+
cost DOUBLE PRECISION,
14+
reverse_cost DOUBLE PRECISION
15+
);
16+
INSERT INTO example_edges_bi (source, target, cost, reverse_cost) VALUES
17+
(1, 2, 1, 1),
18+
(2, 3, 1, 1),
19+
(3, 4, 1, 1);
20+
21+
/* -- q3 */
22+
SELECT * FROM pgr_makeBiconnectedPlanar(
23+
'SELECT id, source, target, cost, reverse_cost FROM example_edges_bi'
24+
);
25+
/* -- q4 */
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
BEGIN;
2+
BEGIN
3+
SET client_min_messages TO NOTICE;
4+
SET
5+
/* :file: This file is part of the pgRouting project.
6+
:copyright: Copyright (c) 2020-2026 pgRouting developers
7+
:license: Creative Commons Attribution-Share Alike 3.0 https://creativecommons.org/licenses/by-sa/3.0 */
8+
/* -- q1 */
9+
SELECT * FROM pgr_makeBiconnectedPlanar(
10+
'SELECT id, source, target, cost, reverse_cost FROM edges'
11+
);
12+
seq | start_vid | end_vid
13+
-----+-----------+---------
14+
1 | 1 | 7
15+
2 | 3 | 11
16+
3 | 5 | 10
17+
4 | 7 | 9
18+
(4 rows)
19+
20+
/* -- q2 */
21+
CREATE TABLE example_edges_bi (
22+
id SERIAL PRIMARY KEY,
23+
source INTEGER,
24+
target INTEGER,
25+
cost DOUBLE PRECISION,
26+
reverse_cost DOUBLE PRECISION
27+
);
28+
CREATE TABLE
29+
INSERT INTO example_edges_bi (source, target, cost, reverse_cost) VALUES
30+
(1, 2, 1, 1),
31+
(2, 3, 1, 1),
32+
(3, 4, 1, 1);
33+
INSERT 0 3
34+
/* -- q3 */
35+
SELECT * FROM pgr_makeBiconnectedPlanar(
36+
'SELECT id, source, target, cost, reverse_cost FROM example_edges_bi'
37+
);
38+
seq | start_vid | end_vid
39+
-----+-----------+---------
40+
1 | 1 | 3
41+
2 | 2 | 4
42+
(2 rows)
43+
44+
/* -- q4 */
45+
ROLLBACK;
46+
ROLLBACK

docqueries/planar/test.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
'any' => {
88
'files' => [qw(
99
isPlanar.pg
10+
makeBiconnectedPlanar.pg
1011
)]
1112
},
1213

0 commit comments

Comments
 (0)