Skip to content

Commit 927879f

Browse files
nike0goodnike0good
authored andcommitted
[transitiveClosure] Add SQL files.
1 parent 7609563 commit 927879f

3 files changed

Lines changed: 113 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
SET(LOCAL_FILES
3+
_transitiveClosure.sql
4+
transitiveClosure.sql
5+
)
6+
7+
foreach (f ${LOCAL_FILES})
8+
configure_file(${f} ${f})
9+
list(APPEND PACKAGE_SQL_FILES ${CMAKE_CURRENT_BINARY_DIR}/${f})
10+
endforeach()
11+
12+
set(PGROUTING_SQL_FILES ${PGROUTING_SQL_FILES} ${PACKAGE_SQL_FILES} PARENT_SCOPE)
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*PGR-GNU*****************************************************************
2+
3+
Copyright (c) 2015 pgRouting developers
4+
Mail: project@pgrouting.org
5+
6+
Function's developer:
7+
Copyright (c) 2019 Hang Wu
8+
mail: nike0good@gmail.com
9+
------
10+
11+
This program is free software; you can redistribute it and/or modify
12+
it under the terms of the GNU General Public License as published by
13+
the Free Software Foundation; either version 2 of the License, or
14+
(at your option) any later version.
15+
16+
This program is distributed in the hope that it will be useful,
17+
but WITHOUT ANY WARRANTY; without even the implied warranty of
18+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19+
GNU General Public License for more details.
20+
21+
You should have received a copy of the GNU General Public License
22+
along with this program; if not, write to the Free Software
23+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24+
25+
********************************************************************PGR-GNU*/
26+
27+
---------------
28+
-- pgr_transitiveClosure
29+
---------------
30+
31+
32+
CREATE OR REPLACE FUNCTION _pgr_transitiveClosure(
33+
edges_sql TEXT,
34+
35+
OUT seq INTEGER,
36+
OUT target_array INTEGER[])
37+
RETURNS SETOF RECORD AS
38+
'MODULE_PATHNAME', 'transitiveClosure'
39+
LANGUAGE c VOLATILE STRICT;
40+
41+
-- COMMENTS
42+
43+
44+
COMMENT ON FUNCTION _pgr_transitiveClosure(TEXT)
45+
IS 'pgRouting internal function';
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*PGR-GNU*****************************************************************
2+
3+
Copyright (c) 2015 pgRouting developers
4+
Mail: project@pgrouting.org
5+
6+
Function's developer:
7+
Copyright (c) 2019 Hang Wu
8+
mail: nike0good@gmail.com
9+
------
10+
11+
This program is free software; you can redistribute it and/or modify
12+
it under the terms of the GNU General Public License as published by
13+
the Free Software Foundation; either version 2 of the License, or
14+
(at your option) any later version.
15+
16+
This program is distributed in the hope that it will be useful,
17+
but WITHOUT ANY WARRANTY; without even the implied warranty of
18+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19+
GNU General Public License for more details.
20+
21+
You should have received a copy of the GNU General Public License
22+
along with this program; if not, write to the Free Software
23+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24+
25+
********************************************************************PGR-GNU*/
26+
27+
---------------
28+
-- pgr_transitiveClosure
29+
---------------
30+
31+
32+
CREATE OR REPLACE FUNCTION pgr_transitiveClosure(
33+
edges_sql TEXT, -- edges_sql (required)
34+
35+
OUT seq INTEGER,
36+
OUT target_array INTEGER[])
37+
RETURNS SETOF RECORD AS
38+
$BODY$
39+
SELECT *
40+
FROM _pgr_transitiveClosure(_pgr_get_statement($1));
41+
$BODY$
42+
LANGUAGE SQL VOLATILE STRICT;
43+
44+
45+
-- COMMENTS
46+
47+
48+
COMMENT ON FUNCTION pgr_transitiveClosure(TEXT)
49+
IS 'pgr_transitiveClosure
50+
- EXPERIMENTAL
51+
- Directed graph
52+
- Parameters:
53+
- edges SQL with columns: id, source, target, cost [,reverse_cost]
54+
- Documentation:
55+
- ${PGROUTING_DOC_LINK}/pgr_transitiveClosure.html
56+
';

0 commit comments

Comments
 (0)